Project

General

Profile

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

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

    
12
SELECT create_if_not_exists($$ALTER TABLE "SUBPLOT" ADD CONSTRAINT "SUBPLOT.ID"     UNIQUE ("subplotID")$$);
13
SELECT create_if_not_exists($$ALTER TABLE "SUBPLOT" ADD CONSTRAINT "SUBPLOT.unique" UNIQUE ("*STATECD", "*UNITCD", "*COUNTYCD", "locationName", "*INVYR", "subplot")$$);
14
SELECT cluster_once('"SUBPLOT"', '"SUBPLOT.unique"');
(7-7/10)