Revision 8184
Added by Aaron Marcuse-Kubitza almost 12 years ago
import | ||
---|---|---|
5 | 5 |
|
6 | 6 |
map_table |
7 | 7 |
psql <<'EOF' |
8 |
SELECT util.set_col_types('"TREE"', ARRAY[
|
|
8 |
SELECT set_col_types('"TREE"', ARRAY[ |
|
9 | 9 |
('STATECD', 'integer') |
10 | 10 |
, ('UNITCD', 'integer') |
11 | 11 |
, ('COUNTYCD', 'integer') |
... | ... | |
14 | 14 |
, ('subplot', 'integer') |
15 | 15 |
, ('authorEventCode', 'integer') |
16 | 16 |
, ('SPCD', 'integer') |
17 |
]::util.col_cast[]);
|
|
17 |
]::col_cast[]); |
|
18 | 18 |
|
19 | 19 |
-- ("STATECD", "UNITCD", "COUNTYCD", "locationName", "INVYR", "authorEventCode", "subplot", "TREE", "STATUSCD") is not ID |
20 |
SELECT util.create_if_not_exists($$ALTER TABLE "TREE" ADD CONSTRAINT "TREE.ID" UNIQUE ("individualObservationID")$$);
|
|
21 |
SELECT util.cluster_once('"TREE"', '"TREE.ID"');
|
|
20 |
SELECT create_if_not_exists($$ALTER TABLE "TREE" ADD CONSTRAINT "TREE.ID" UNIQUE ("individualObservationID")$$); |
|
21 |
SELECT cluster_once('"TREE"', '"TREE.ID"'); |
|
22 | 22 |
|
23 |
SELECT util.create_if_not_exists($$CREATE INDEX "TREE.parent" ON "TREE" ("STATECD", "UNITCD", "COUNTYCD", "locationName", "INVYR", "authorEventCode", "subplot")$$); |
|
23 |
SELECT create_if_not_exists($$CREATE INDEX "TREE.parent" ON "TREE" ("STATECD", "UNITCD", "COUNTYCD", "locationName", "INVYR", "authorEventCode", "subplot")$$); |
Also available in: Unified diff
inputs/FIA/*/import: Removed util. before function names because util is in the search_path