Upgrading containerized PostgreSQL with non-default socket directory

Solution Verified - Updated -

Issue

  • Upgrading PostgreSQL fails due to a non-default socket directory in use.
  • Upgrade fails with below error:
-----------------------
Performing Consistency Checks
-----------------------------
Checking current, bin, and data directories                 ok
Checking cluster versions                                   ok
*failure*
Consult the last few lines of "pg_upgrade_server.log" for
the probable cause of the failure.

connection to database failed: could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?


could not connect to old postmaster started with the command:
"/usr/lib64/pgsql/postgresql-8.4/bin/pg_ctl" -w -l "pg_upgrade_server.log" -D "/var/lib/pgsql/data-old" -o "-p 5432 -c autovacuum=off -c autovacuum_freeze_max_age=2000000000  -c listen_addresses='' -c unix_socket_permissions=0700" start
Failure, exiting
  • How to use POSTGRESQL_UPGRADE_PGUPGRADE_OPTIONS to change the Unix socket path?

Environment

  • Red Hat OpenShift Container Platform
    • 3.11
  • PostgreSQL
    • 10.6

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content