   column_ids as (
     select row_number() over () as no, a.column_id as column_id from (select unnest($2) as column_id) a
   )
- SELECT array_agg(ROW(colname, tablename, aggregate)::OBS_ColumnData order by column_ids.no)
+ SELECT array_agg(ROW(colname, tablename, aggregate)::cdb_observatory.OBS_ColumnData order by column_ids.no)
  FROM column_ids, observatory.OBS_column c, observatory.OBS_column_table ct, observatory.OBS_table t
  WHERE column_ids.column_id  = c.id
    AND c.id = ct.column_id

-- TODO probably needs to take in the column_id array to get the relevant
-- table where there is multiple sources for a column from multiple
-- geometries.
CREATE OR REPLACE FUNCTION OBS_GeomTable(
  geom geometry,
  geometry_id text
)


--Test polygon cause Stuart always seems to make random points in the water
-- TODO: remove as it's not used anywhere?
CREATE OR REPLACE FUNCTION cdb_observatory._TestArea()
  RETURNS geometry
AS $$
BEGIN
