   EXECUTE
   $string$
       select
-        column_id,
+        column_id boundary_id,
         obs_column.description,
-        table_id
+        timespan time_span,
+        tablename
       FROM
         observatory.OBS_table,
         observatory.OBS_column_table,
         observatory.OBS_column
       WHERE
         observatory.OBS_column_table.column_id = observatory.obs_column.id
+        observatory.OBS_column_table.table_id = observatory.obs_table.id
       AND
         observatory.OBS_column.type='Geometry'
       AND


  RETURN QUERY
  EXECUTE format($string$
              SELECT description,
                name,
                  aggregate,
                  replace(split_part(id,'".', 1),'"', '') source

CREATE OR REPLACE FUNCTION OBS_GetAvailableBoundaries(
  geom geometry,
  time_span text DEFAULT null)
RETURNS TABLE(boundary_id text, description text, time_span text, tablename text)  as $$
DECLARE
  timespan_query TEXT DEFAULT '';
BEGIN
