This is a notice to those who have previously upgraded NAV from 3.4 to 3.5
and will be upgrading to 3.6 now.
We've received some reports from users on IRC about errors during the attempt
to upgrade the SQL schema from NAV 3.5 to 3.6. As we're on the brink of
upgrading multiple deployments of NAV among our customers, we're seeing the
same problems ourselves.
During the upgrade from 3.4 to 3.5, a lot changed in the database. Most
notably, the multiple databases were merged into one. But also, several
indexes were renamed. For some reason, not all of these renames have stuck
with some PostgreSQL installations.
We really have no idea why; all the rename statements are present in the
upgrade script 3.5.0.sql, and they're all run in the same transaction. If any
of them failed, the entire transaction should have been rolled back and all
the changes thrown away, and we would have heard of it.
If you receive an error that looks like this while upgrading the schema to
3.6.0, you are affected by the problem:
psql:3.6.0b1.sql:433: ERROR: constraint "accountnavbar_pkey" does not exist
The problem can be fixed by re-issuing all the index renaming statements from
3.5.0.sql using psql almost the same way as you would during the upgrade.
Connect to the nav database using "psql <navdb> <navuser> <password>" (the
db name, user name and password can be found in db.conf), and issue the
following ALTER statements:
ALTER INDEX logger.message_pkey RENAME TO log_message_pkey;
ALTER INDEX logger.message_origin_btree RENAME TO log_message_origin_btree;
ALTER INDEX logger.message_time_btree RENAME TO log_message_time_btree;
ALTER INDEX logger.message_type_btree RENAME TO log_message_type_btree;
ALTER INDEX logger.type_pkey RENAME TO log_message_type_pkey;
ALTER INDEX logger.type_priority_key RENAME TO log_message_type_priority_key;
ALTER INDEX account_pk RENAME TO account_pkey;
ALTER INDEX brukernavn_uniq RENAME TO account_login_key;
ALTER INDEX accountgroup_pk RENAME TO accountgroup_pkey;
ALTER INDEX alarmadresse_pk RENAME TO alertaddress_pkey;
ALTER INDEX brukerprofil_pk RENAME TO alertprofile_pkey;
ALTER INDEX preference_pk RENAME TO alertpreference_pkey;
ALTER INDEX tidsperiode_pk RENAME TO timeperiod_pkey;
ALTER INDEX utstyrgruppe_pk RENAME TO filtergroup_pkey;
ALTER INDEX utstyrfilter_pk RENAME TO filter_pkey;
ALTER INDEX matchfield_pk RENAME TO matchfield_pkey;
ALTER INDEX filtermatch_pk RENAME TO expression_pkey;
ALTER INDEX queue_pkey RENAME TO accountalertqueue_pkey;
ALTER INDEX navbarlink_pk RENAME TO navbarlink_pkey;
ALTER INDEX accountnavbar_pk RENAME TO accountnavbar_pkey;
ALTER INDEX privilege_pk RENAME TO privilege_pkey;
ALTER INDEX privilegename_uniq RENAME TO privilege_privilegename_key;
Some of them may fail with an error message like 'relation "xxx" does not
exist', but that is just an indication that the rename stuck the first time
around. Exit psql and try the schema upgrade again.