SELECT util.search_path_append('util'); -- contains the research station *and state name* for each state SELECT set_col_types('"REF_RESEARCH_STATION"', ARRAY[ ('*STATECD', 'integer') ]::col_cast[]); SELECT create_if_not_exists($$ALTER TABLE "REF_RESEARCH_STATION" ADD CONSTRAINT "REF_RESEARCH_STATION.unique" UNIQUE ("*STATECD")$$);