Revision 10156
Added by Aaron Marcuse-Kubitza over 11 years ago
lib/runscripts/table.run | ||
---|---|---|
46 | 46 |
{ |
47 | 47 |
echo_func; set_make_vars |
48 | 48 |
table_make map.csv |
49 |
local map_table="\"~$table.map\"" # sort after other tables to avoid clutter |
|
49 | 50 |
psql <<EOF |
50 |
SELECT util.reset_map_table('temp.map');
|
|
51 |
ALTER TABLE temp.map DISABLE TRIGGER map_filter_insert;
|
|
52 |
\copy temp.map FROM 'map.csv' CSV HEADER;
|
|
53 |
SELECT util.set_col_names_with_metadata('"$table"', 'temp.map'::regclass);
|
|
51 |
SELECT util.reset_map_table('$map_table');
|
|
52 |
ALTER TABLE $map_table DISABLE TRIGGER map_filter_insert;
|
|
53 |
\copy $map_table FROM 'map.csv' CSV HEADER;
|
|
54 |
SELECT util.set_col_names_with_metadata('"$table"', '$map_table'::regclass);
|
|
54 | 55 |
EOF |
55 | 56 |
} |
56 | 57 |
|
Also available in: Unified diff
lib/runscripts/table.run: map_table(): store the map table in the datasource schema, so that it can easily be referred to when using the staging tables. this also allows it to be found more easily when debugging its contents.