1

I am using Ubuntu server. I am trying to install postgresql on it. when I try to start postgres using sudo service postgresql start it result me into

*No PostgreSQL clusters exist; see "man pg_createcluster"

and when I try to create cluster using command pg_createcluster --start 9.6 main (*9.6 is my postgres version)

The result is as follows

Creating new PostgreSQL cluster 9.6/main ...
/usr/lib/postgresql/9.6/bin/initdb -D /var/lib/postgresql/9.6/main -- 
auth-local peer --auth-host md5
initdb: could not look up effective user ID 108: Permission denied
Error: initdb failed

I am not able to figure out what is the issue please help.

dArK kNiGhT
  • 151
  • 2
  • 12

1 Answers1

1

It looks like your /etc/passwd is not readable. I'm not sure which distro would require it, but it is a problem for initdb.

I believe fast solution would be running as root chmod 644 /etc/passwd

And follow with

/usr/lib/postgresql/9.6/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start

command

dArK kNiGhT
  • 151
  • 2
  • 12
Vao Tsun
  • 47,234
  • 13
  • 100
  • 132