Facing permission issue when creating application using postgres image

Solution Verified - Updated -

Issue

  • When postrgres image is used with persistent storage it always fails with below errors :
waiting for server to start....FATAL:  data directory "/var/lib/pgsql/data/userdata" has wrong ownership
HINT:  The server must be started by the user that owns the data directory.
pg_ctl: could not start server
Examine the log output.
 stopped waiting

or

chmod: changing permissions of '/var/lib/pgsql/data/userdata': Operation not permitted

Environment

  • Openshift Container Platform
    • 3.x
    • 4.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In