linz / gazetteer

New Zealand Gazetteer of official place names
http://www.linz.govt.nz/regulatory/place-names/find-name/new-zealand-gazetteer-official-geographic-names/new-zealand-gazetteer-search-place-names#zoom=0&lat=-41.14127&lon=172.5&layers=BTTT
Other
2 stars 2 forks source link

install.sh on an empty DB results in ERROR: relation "system_code" does not exist #66

Open strk opened 4 years ago

strk commented 4 years ago

Running install.sh from src/sql directory results in this error:

psql:gazetteer_functions.sql:169: ERROR:  relation "system_code" does not exist
LINE 5:     SELECT NOT EXISTS (SELECT * FROM system_code WHERE code_...

Where is system_code table or view expected to be created ?

\cc @SPlanzer @palmerj

strk commented 4 years ago

Found: src/sql/gazetteer_schema.sql creates the table on line 35, so there seem to be a problem of order in which sql files are loaded by install.sh

strk commented 4 years ago

The schema.sql file is NOT loaded by install.sh UNLESS the drop argument is passed. But that file does NOT drop anything anymore (maybe it did in the past, because there's a commented-out line that does a DROP cascade). What about removing the "drop" argument from install.sh ?

Or shall I create a new script, following best practices from the linz-bde-schema-loader and friends ? It would be named linz-gazetteer-schema-loader...