I upgraded to Mac OS 10.10 Yosemite and am unable to connect to PostGIS databases (PostgreSQL version 9.3 and PostGIS installed from KyngChaos). Typing psql my_database
returns this message:
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
The responses to this question suggest some postgres directories get removed during a Yosemite upgrade, but following the recommended solutions doesn't fix my error.
As requested, here are my conf settings (just showing those that aren't commented out):
listen_addresses = '*'
port = 5432
max_connections = 20
shared_buffers = 128MB
log_destination = 'stderr'
logging_collector = on
log_directory = '../var'
log_filename = 'postgresql-%Y-%m-%d.log'
log_line_prefix = '%t'
log_timezone = 'US/Pacific'
datestyle = 'iso, mdy'
timezone = 'US/Pacific'
lc_messages = 'en_US'
lc_monetary = 'en_US'
lc_numeric = 'en_US'
lc_time = 'en_US'
default_text_search_config = 'pg_catalog.english'
Best Answer
I can't leave a comment due to low reputation, so will extend @pistachionut's answer as a separate one.
In my case the contents of
/usr/local/pgsql/data
are owned by user_postgres
. Thus, to recreate missing directories it is necessary to run the commands as that user:If this is not done, you will see errors in the log file such as the following:
After the folders are created, Postgres can be launched with no need to restart your Mac: