[MacPorts] #30125: psql: could not connect to server: Permission denied

MacPorts noreply at macports.org
Fri Jul 22 10:14:00 PDT 2011


#30125: psql: could not connect to server: Permission denied
--------------------------------+-------------------------------------------
 Reporter:  conradwt@…          |       Owner:  macports-tickets@…                   
     Type:  defect              |      Status:  new                                  
 Priority:  Normal              |   Milestone:                                       
Component:  ports               |     Version:  1.9.2                                
 Keywords:  lion x86_64         |        Port:  postgresql90-server                  
--------------------------------+-------------------------------------------

Comment(by jasonw@…):

 I was able to get it working with the database I had already configured.
 It seems that Lion ships with PostgreSQL clients (perhaps after installing
 Xcode):

 {{{
 $ which psql
 /usr/bin/psql
 $ psql postgres postgres
 psql: could not connect to server: Permission denied
         Is the server running locally and accepting
         connections on Unix domain socket
 "/var/pgsql_socket/.s.PGSQL.5432"?
 }}}

 However, if I force psql to use TCPIP by specifying a hostname, all is
 well:

 {{{
 $ psql -h localhost postgres postgres
 psql (9.0.4)
 Type "help" for help.

 postgres=#
 }}}

 Alternatively, when I put the MacPorts clients first in my path, I had no
 problem connecting using Unix domain sockets:

 {{{
 $ export PATH=/opt/local/lib/postgresql90/bin:$PATH
 $ which psql
 /opt/local/lib/postgresql90/bin/psql
 $ psql postgres postgres
 psql (9.0.4)
 Type "help" for help.

 postgres=#
 }}}

 Hope this helps!

-- 
Ticket URL: <https://trac.macports.org/ticket/30125#comment:3>
MacPorts <http://www.macports.org/>
Ports system for Mac OS


More information about the macports-tickets mailing list