Re: Error message "psql: could not connect to server: No such file or directory"

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Craig Ringer <ringerc(at)ringerc(dot)id(dot)au>
Cc: Stefan Schwarzer <stefan(dot)schwarzer(at)unep(dot)org>, pgsql-general(at)postgresql(dot)org
Subject: Re: Error message "psql: could not connect to server: No such file or directory"
Date: 2012-06-25 13:52:01
Message-ID: 20191.1340632321@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Craig Ringer <ringerc(at)ringerc(dot)id(dot)au> writes:
> On 06/25/2012 04:21 PM, Stefan Schwarzer wrote:
>> When I type in:
>>
>> sudo -u _postgres /usr/local/pgsql-9.1/bin/postgres -D /usr/local/pgsql-9.1/data
>>
>> it spits out:
>>
>> LOG: 00000: could not identify current directory: Permission denied

> It's trying to get information on the current directory - probably your
> home dir - but the _postgres user doesn't have access to it.

Try adding the "-i" option to the sudo command. Starting postgres
under whatever environment you happen to have in your interactive shell
isn't a very good idea anyway --- things will be more predictable with
user _postgres' login environment.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2012-06-25 14:09:14 Re: explain doubt
Previous Message Luca Ferrari 2012-06-25 13:37:07 explain doubt