With a freshly installed version of Postgres 9.2 via yum repository on Centos 6, how do you run postgres as a different user when it is configured to run as ‘postgres:postgres’ (u:g) out of the box?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is only for a fresh installation (as it pertained to my situation) as it involves blowing away the data dir.
The steps I took to resolve this issue while utilizing the packaged startup scripts for a fresh installation:
/var/lib/pgsql/9.2/dataif you’ve already gone through the initdb process with the postgres user:group configured as default./etc/init.d/postgresql-9.2) to replace all instances ofpostgres:postgreswithNEWUSER:NEWGROUP.postgresin any$SU -l postgreslines with theNEWUSER./etc/init.d/postgres initdbto regenerate the cluster using the new username/var/lib/pgsql/9.2/data/postgresql.conf).I understand this might not be what other people are looking for if they have existing postgres db’s and want to restart the server to run as a different user/group combo – this was not my case, and I didn’t see an answer posted anywhere for a ‘fresh’ install utilizing the pre-packaged startup scripts.