Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#3347 closed defect (fixed)

loader_load_staged_data function relies on the order of columns be returned in ordinal_position order

Reported by: robe Owned by: robe
Priority: blocker Milestone: PostGIS 2.1.9
Component: tiger geocoder Version: master
Keywords: history Cc:

Description (last modified by robe)

UPDATE:


The real issue is that the tiger.loader_load_staged_data function does not enforce order of return of columns and evidentally the ALTER RENAME and if your database has enough columns changes its preferred order of return of column names from informaton_schema.columns. The fix is to force the order by ordinal_position.


I'm not sure how I could have missed this. Might have been something changed in tiger data, but the county tables no longer loading.

Issue is as part of script I rename

ALTER TABLE tiger_staging.county RENAME geoid TO cntyidfp; 

and that is causing issues since ctyidfp exists in county tables.

Change History (9)

comment:1 by robe, 9 years ago

Resolution: invalid
Status: newclosed

nevermind. Something else is up here. Could be my 9.4 scripts are wacked because i just tried on my 9.5beta1 freshly installed 2.2.0 instance and it worked fine.

comment:2 by robe, 9 years ago

Resolution: invalid
Status: closedreopened
Summary: county_all, county_all_lookup not loading for Tiger 2015Loader functions rely on the order of columns be returned in ordinal_position order

Okay there is an issue here. I'm not sure why I never ran into it before. It could be because this particular database has more than a thousand tables so the query planner does something different.

The fundamental issue is that when building list on columns, the loader is assuming the columns in information_schema.columns will be returned in ordinal position if no order by is specified. This is not the case with this particular database anyway.

I think someone actually complained about this but I didn't understand why they tried to change the load scripts and why it was failing on their system. Anyway it's a simple fix.

Will test and upport and backport after I have tested my patch.

comment:3 by robe, 9 years ago

Description: modified (diff)

comment:4 by robe, 9 years ago

Milestone: PostGIS 2.2.1PostGIS 2.1.9
Summary: Loader functions rely on the order of columns be returned in ordinal_position orderloader_load_staged_data function relies on the order of columns be returned in ordinal_position order

comment:5 by robe, 9 years ago

(In [14314]) addresses #3347 force order of staged insert columns to be in table column order

comment:6 by robe, 9 years ago

(In [14315]) addresses #3347 force order of staged insert columns to be in table column order

comment:7 by robe, 9 years ago

(In [14316]) addresses #3347 force order of staged insert columns to be in table column order

comment:8 by robe, 9 years ago

Resolution: fixed
Status: reopenedclosed

(In [14317]) closes #3347 force order of staged insert columns to be in table column order

comment:9 by robe, 9 years ago

Keywords: history added
Note: See TracTickets for help on using tickets.