[MacPorts] #68348: psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed

MacPorts noreply at macports.org
Tue Oct 3 22:14:43 UTC 2023


#68348: psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed
----------------------+---------------------------------
 Reporter:  conradwt  |      Owner:  (none)
     Type:  defect    |     Status:  new
 Priority:  Normal    |  Milestone:
Component:  ports     |    Version:
 Keywords:            |       Port:  postgresql15-server
----------------------+---------------------------------
 First, I have performed the following steps on both macOS 11.7.10 (Big
 Sur) and macOS 14 (Sonoma):

 {{{
 sudo port install postgresql15-server postgresql15
 sudo port select postgresql postgresql15
 sudo mkdir -p /opt/local/var/db/postgresql15/defaultdb
 sudo chown postgres:postgres /opt/local/var/db/postgresql15/defaultdb
 sudo su postgres -c 'cd /opt/local/var/db/postgresql15 &&
 /opt/local/lib/postgresql15/bin/initdb -D
 /opt/local/var/db/postgresql15/defaultdb'
 sudo port load postgresql15-server
 }}}

 When I attempt to access psql, I'm getting the following error:

 {{{
 ➜ psql -U postgres
 psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed:
 No such file or directory
         Is the server running locally and accepting connections on that
 socket?
 }}}

 Finally, I also tried using the following command without success:

 {{{
 /opt/local/lib/postgresql15/bin/pg_ctl -D
 /opt/local/var/db/postgresql15/defaultdb -l logfile start
 pg_ctl: could not open PID file
 "/opt/local/var/db/postgresql15/defaultdb/postmaster.pid": Permission
 denied
 }}}

-- 
Ticket URL: <https://trac.macports.org/ticket/68348>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list