Solved - migrate from sameersbn/postgresql to official postgresql:12 docker image

After upgrade from Gitlab 12.8 to 12.9 sameersbn/gitlab:12.9 I got this error ERROR: operator class "gin_trgm_ops" does not exist for access method "gin"

In official PostgreSQL docker image is no DB_EXTENSION ENV param, so you have to manually enable pg_trgm extension.

You can solve it by running this SQL update create extension pg_trgm with schema pg_catalog; on your gitlab database (not on postgre db! if is not only one db you have =) ).

Missing PostgreSQL superuser

I discovered, that there is no superuser in my PostgresSQL. You can add new superuser only in single mode run.

Shut down your postgresSQL server a run it with single mode param and data directory.

  • postgres --single -D /var/lib/postgresql/12
  • pqsl
  • CREATE ROLE postgres WITH SUPERUSER CREATEDB CREATEROLE LOGIN ENCRYPTED PASSWORD 'yoursecretpassword';

And run your postgreSQL again in normal mode.