Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

The default configuration in /var/pgsql/postgresql.conf says that listen_addresses defaults to localhost, but it doesn't let me connect over port 5432. Connecting (as root, using sudo) over a Unix domain socket works fine, but I need to enable network connections.

I tried uncommenting the listen_addresses = 'localhost' line (to make it explicit), and restarting the Postgres process (with sudo serveradmin stop postgres, sudo serveradmin start postgres), but that didn't help.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

The Postgres process started by "serveradmin" has command-line arguments added by /System/Library/LaunchDaemons/org.postgresql.postgres.plist. The default includes -c listen_addresses=, which turns off TCP/IP.

Changing it to listen_addresses=localhost, and restarting Postgres, solved the problem. (I suppose I could probably also remove the -c argument entirely.)

(One comment I found somewhere suggested that in 10.8 Server, the file you need to edit is /Library/Server/PostgreSQL/Config/org.postgresql.postgres.plist, but I haven't upgraded to 10.8 yet so I can't confirm this.)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.