Revision 10148
Added by Aaron Marcuse-Kubitza over 11 years ago
lib/runscripts/table.run | ||
---|---|---|
48 | 48 |
table_make map.csv |
49 | 49 |
psql <<EOF |
50 | 50 |
SELECT util.reset_map_table('pg_temp.map'); |
51 |
ALTER TABLE pg_temp.map DISABLE TRIGGER map_filter_insert; |
|
51 | 52 |
\copy pg_temp.map FROM 'map.csv' CSV HEADER; |
52 |
SELECT util.set_col_names('"$table"', 'pg_temp.map'::regclass); |
|
53 |
SELECT util.set_col_names_with_metadata('"$table"', 'pg_temp.map'::regclass);
|
|
53 | 54 |
EOF |
54 | 55 |
} |
55 | 56 |
|
Also available in: Unified diff
lib/runscripts/table.run: use new util.set_col_names_with_metadata() instead of util.set_col_names() so that metadata values (beginning with : ) are automatically mapped to constant columns rather than needing to add a mk_const_col() call to postprocess.sql for each of them. there are a lot of metadata value entries, especially in the Source/ tables for each datasource, so this will save time in translating the datasources to new-style import. note that this requires disabling the map_filter_insert trigger on the map table to prevent it from filtering out the metadata entries before util.set_col_names_with_metadata() can use them.