SELECT util.search_path_append('util'); SELECT set_col_types('"SUBPLOT"', ARRAY[ ('*STATECD', 'integer') , ('*UNITCD', 'integer') , ('*COUNTYCD', 'integer') , ('locationName', 'integer') , ('*INVYR', 'integer') , ('subplot', 'integer') ]::col_cast[]); SELECT create_if_not_exists($$ALTER TABLE "SUBPLOT" ADD CONSTRAINT "SUBPLOT.ID" UNIQUE ("subplotID")$$); SELECT create_if_not_exists($$ALTER TABLE "SUBPLOT" ADD CONSTRAINT "SUBPLOT.unique" UNIQUE ("*STATECD", "*UNITCD", "*COUNTYCD", "locationName", "*INVYR", "subplot")$$); SELECT cluster_once('"SUBPLOT"', '"SUBPLOT.unique"');