 
 
 --Test point cause Stuart always seems to make random points in the water
-CREATE OR REPLACE FUNCTION _TestPoint()
+CREATE OR REPLACE FUNCTION cdb_observatory._TestPoint()
   RETURNS geometry
 AS $$
 BEGIN

$$ LANGUAGE plpgsql;

-- A type for use with the OBS_GetColumnData function
CREATE TYPE OBS_ColumnData AS (colname text, tablename text, aggregate text);


-- A function that gets the column data for multiple columns
-- Old: OBS_GetColumnData
CREATE OR REPLACE FUNCTION OBS_GetColumnData(
  geometry_id text,
  column_ids text[],
  timespan text
)
RETURNS OBS_ColumnData[]
AS $$
DECLARE
  result OBS_ColumnData[];
BEGIN
  EXECUTE '
  WITH geomref AS (

--Gets the column id for a census variable given a human readable version of it
-- Old: OBS_LOOKUP_CENSUS_HUMAN

CREATE OR REPLACE FUNCTION cdb_observatory.OBS_LookupCensusHuman(
  column_names text[],
  -- TODO: change variable name table_name to table_id
  table_name text DEFAULT '"us.census.acs".extract_block_group_5yr_2013_69b156927c'
