                         boundary_id,
                         time_span,
                         overlap_type);
+  RETURN;
 END;
 $$ LANGUAGE plpgsql;
 

  THEN
    RAISE NOTICE 'No boundaries found for bounding box ''%'' in ''%''', ST_AsText(geom), boundary_id;
    RETURN QUERY SELECT NULL::geometry, NULL::text;
  END IF;

  RAISE NOTICE 'target_table: %', target_table;

          geom_c.type ILIKE 'geometry' AND
          geom_c.id = '%s'
    $string$, boundary_id, boundary_id);
  RETURN;
    --  AND geom_t.timespan = '%s' <-- put in requested year
    -- TODO: filter by clipped vs. not so appropriate tablename are unique
    --       so the limit 1 can be removed
