Manual Security Server Database Schema Update When Upgrading to Version 6.24.0

When upgrading to version 6.24.0, the database schema is renamed and the migration requires that installer can access the database using administrative permissions. In case sufficient permissions are not available, the upgrade will fail (couple of examples of the failure below) and some manual steps are needed.

Database and user exists, skipping database creation.
Liquibase Home is not set.
Liquibase Update Successful
psql: FATAL:  password authentication failed for user "postgres"
Renaming public schema to 'serverconf' failed.


Database and user exists, skipping database creation.
Liquibase Home is not set.
Liquibase Update Successful
ERROR:  must be owner of database serverconf
Renaming public schema to 'serverconf' failed.

Fixing the database manually

  1. Connect to the database as a database super-user (e.g. psql -h database.host -U postgres serverconf)
  2. Run the following commands:

    ALTER DATABASE "serverconf" OWNER TO "postgres";
    REVOKE ALL ON DATABASE "serverconf" FROM PUBLIC;
    GRANT CREATE,TEMPORARY,CONNECT ON DATABASE "serverconf" TO "serverconf";
    ALTER SCHEMA public RENAME TO "serverconf";
    ALTER SCHEMA "serverconf" OWNER TO "serverconf";
    REVOKE ALL ON SCHEMA "serverconf" FROM PUBLIC;
    CREATE SCHEMA public;
    GRANT USAGE ON SCHEMA public TO "serverconf";
    ALTER EXTENSION hstore SET SCHEMA public;
  3. Continue installation:
    • Ubuntu: apt --fix-broken install
    • RHEL: yum reinstall xroad-proxy