Project

General

Profile

« Previous | Next » 

Revision 8136

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

View differences:

postprocess.sql
1
SELECT functions.to_global_col_names(:table_str);
1
SELECT functions.to_global_col_names('"COND"');
2 2

  
3 3
SELECT functions.rename_if_exists($$ALTER TABLE "COND" RENAME "COND.STATECD"          TO ".STATECD"      $$);
4 4
SELECT functions.rename_if_exists($$ALTER TABLE "COND" RENAME "COND.UNITCD"           TO ".UNITCD"       $$);
......
9 9
SELECT functions.rename_if_exists($$ALTER TABLE "COND" RENAME "COND.HABTYPCD1"        TO ".HABTYPCD"     $$);
10 10
SELECT functions.rename_if_exists($$ALTER TABLE "COND" RENAME "COND.HABTYPCD1_PUB_CD" TO ".HABTYP_PUB_CD"$$);
11 11

  
12
SELECT functions.set_col_types(:table_str, ARRAY[
12
SELECT functions.set_col_types('"COND"', ARRAY[
13 13
  ('.STATECD' , 'integer')
14 14
, ('.UNITCD'  , 'integer')
15 15
, ('.COUNTYCD', 'integer')
......
36 36

  
37 37
SELECT functions.create_if_not_exists($$ALTER TABLE "COND" ADD CONSTRAINT "COND.ID"     UNIQUE ("COND.CN")                                                       $$);
38 38
SELECT functions.create_if_not_exists($$ALTER TABLE "COND" ADD CONSTRAINT "COND.unique" UNIQUE (".STATECD", ".UNITCD", ".COUNTYCD", ".PLOT", ".INVYR", ".CONDID")$$);
39
SELECT functions.cluster_once(:table_str, '"COND.unique"');
39
SELECT functions.cluster_once('"COND"', '"COND.unique"');

Also available in: Unified diff