[postgis-tickets] r14314 - addresses #3347 force order of staged insert columns to be in table column order
Regina Obe
lr at pcorp.us
Sat Oct 24 15:07:51 PDT 2015
Author: robe
Date: 2015-10-24 15:07:51 -0700 (Sat, 24 Oct 2015)
New Revision: 14314
Modified:
branches/2.2/extras/tiger_geocoder/tiger_loader_2014.sql
branches/2.2/extras/tiger_geocoder/tiger_loader_2015.sql
Log:
addresses #3347 force order of staged insert columns to be in table column order
Modified: branches/2.2/extras/tiger_geocoder/tiger_loader_2014.sql
===================================================================
--- branches/2.2/extras/tiger_geocoder/tiger_loader_2014.sql 2015-10-24 21:29:37 UTC (rev 14313)
+++ branches/2.2/extras/tiger_geocoder/tiger_loader_2014.sql 2015-10-24 22:07:51 UTC (rev 14314)
@@ -486,12 +486,14 @@
FROM information_schema.columns
WHERE table_name = param_target_table
AND table_schema = var_data_schema
- AND column_name <> ALL(param_columns_exclude) ), ',') || ') SELECT '
+ AND column_name <> ALL(param_columns_exclude)
+ ORDER BY ordinal_position ), ',') || ') SELECT '
|| array_to_string(ARRAY(SELECT quote_ident(column_name::text)
FROM information_schema.columns
WHERE table_name = param_staging_table
AND table_schema = var_staging_schema
- AND column_name <> ALL( param_columns_exclude) ), ',') ||' FROM '
+ AND column_name <> ALL( param_columns_exclude)
+ ORDER BY ordinal_position ), ',') ||' FROM '
|| var_staging_schema || '.' || param_staging_table || ';';
RAISE NOTICE '%', var_sql;
EXECUTE (var_sql);
Modified: branches/2.2/extras/tiger_geocoder/tiger_loader_2015.sql
===================================================================
--- branches/2.2/extras/tiger_geocoder/tiger_loader_2015.sql 2015-10-24 21:29:37 UTC (rev 14313)
+++ branches/2.2/extras/tiger_geocoder/tiger_loader_2015.sql 2015-10-24 22:07:51 UTC (rev 14314)
@@ -486,12 +486,14 @@
FROM information_schema.columns
WHERE table_name = param_target_table
AND table_schema = var_data_schema
- AND column_name <> ALL(param_columns_exclude) ), ',') || ') SELECT '
+ AND column_name <> ALL(param_columns_exclude)
+ ORDER BY ordinal_position ), ',') || ') SELECT '
|| array_to_string(ARRAY(SELECT quote_ident(column_name::text)
FROM information_schema.columns
WHERE table_name = param_staging_table
AND table_schema = var_staging_schema
- AND column_name <> ALL( param_columns_exclude) ), ',') ||' FROM '
+ AND column_name <> ALL( param_columns_exclude)
+ ORDER BY ordinal_position ), ',') ||' FROM '
|| var_staging_schema || '.' || param_staging_table || ';';
RAISE NOTICE '%', var_sql;
EXECUTE (var_sql);
More information about the postgis-tickets
mailing list