#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 )
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 , 9 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:2 by , 9 years ago
Resolution: | invalid |
---|---|
Status: | closed → reopened |
Summary: | county_all, county_all_lookup not loading for Tiger 2015 → Loader 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 , 9 years ago
Description: | modified (diff) |
---|
comment:4 by , 9 years ago
Milestone: | PostGIS 2.2.1 → PostGIS 2.1.9 |
---|---|
Summary: | Loader functions rely on the order of columns be returned in ordinal_position order → loader_load_staged_data function relies on the order of columns be returned in ordinal_position order |
comment:5 by , 9 years ago
comment:6 by , 9 years ago
comment:7 by , 9 years ago
comment:8 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
comment:9 by , 9 years ago
Keywords: | history added |
---|
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.