Project

General

Profile

1
SELECT util.search_path_append('util');
2

    
3
SELECT set_col_types('"PLOT"', ARRAY[
4
  ('*STATECD', 'integer')
5
, ('*UNITCD', 'integer')
6
, ('*COUNTYCD', 'integer')
7
, ('locationName', 'integer')
8
, ('*INVYR', 'integer')
9
]::col_cast[]);
10

    
11
SELECT create_if_not_exists($$ALTER TABLE "PLOT" ADD CONSTRAINT "PLOT.ID"     UNIQUE ("locationID")$$);
12
SELECT create_if_not_exists($$ALTER TABLE "PLOT" ADD CONSTRAINT "PLOT.unique" UNIQUE ("*STATECD", "*UNITCD", "*COUNTYCD", "locationName", "*INVYR")$$);
13
SELECT cluster_once('"PLOT"', '"PLOT.unique"');
(6-6/8)