Revision 8136
Added by Aaron Marcuse-Kubitza almost 12 years ago
postprocess.sql | ||
---|---|---|
1 |
SELECT functions.to_global_col_names(:table_str);
|
|
1 |
SELECT functions.to_global_col_names('"PLOT"');
|
|
2 | 2 |
|
3 | 3 |
SELECT functions.rename_if_exists($$ALTER TABLE "PLOT" RENAME "PLOT.STATECD" TO ".STATECD" $$); |
4 | 4 |
SELECT functions.rename_if_exists($$ALTER TABLE "PLOT" RENAME "PLOT.UNITCD" TO ".UNITCD" $$); |
... | ... | |
6 | 6 |
SELECT functions.rename_if_exists($$ALTER TABLE "PLOT" RENAME "PLOT.PLOT" TO ".PLOT" $$); |
7 | 7 |
SELECT functions.rename_if_exists($$ALTER TABLE "PLOT" RENAME "PLOT.INVYR" TO ".INVYR" $$); |
8 | 8 |
|
9 |
SELECT functions.set_col_types(:table_str, ARRAY[
|
|
9 |
SELECT functions.set_col_types('"PLOT"', ARRAY[
|
|
10 | 10 |
('.STATECD' , 'integer') |
11 | 11 |
, ('.UNITCD' , 'integer') |
12 | 12 |
, ('.COUNTYCD', 'integer') |
... | ... | |
16 | 16 |
|
17 | 17 |
SELECT functions.create_if_not_exists($$ALTER TABLE "PLOT" ADD CONSTRAINT "PLOT.ID" UNIQUE ("PLOT.CN") $$); |
18 | 18 |
SELECT functions.create_if_not_exists($$ALTER TABLE "PLOT" ADD CONSTRAINT "PLOT.unique" UNIQUE (".STATECD", ".UNITCD", ".COUNTYCD", ".PLOT", ".INVYR")$$); |
19 |
SELECT functions.cluster_once(:table_str, '"PLOT.unique"'); |
|
19 |
SELECT functions.cluster_once('"PLOT"', '"PLOT.unique"'); |
Also available in: Unified diff
inputs/FIA/*/postprocess.sql: Avoid using :table, :table_str so that the commands in the script can also be run by pasting them into pgAdmin