sudo -u postgres psql

Bill Cole macportsusers-20171215 at
Wed Sep 18 20:06:18 UTC 2019

On 18 Sep 2019, at 12:27, Yves de Champlain wrote:

> Hi
> I can’t find a way to use psql 11 through command line :

Perhaps run 'man psql' for more complete help?

> yves$ sudo -u postgres psql
> Password:
> could not identify current directory: Permission denied
> could not identify current directory: Permission denied
> psql: could not find own program executable

Presumably this means that you have a system-level user named 'postgres' 
but it doesn't have any rights and sudo has stripped its environment 
down to being useless.

This is actually fine, since such an account would normally only be used 
for running the daemon.

What you should run (assuming that you have a postgres daemon up and 
running) is:

psql -U postgres

This also assumes that you've got a 'postgres' user configured for the 
running daemon/

Bill Cole
bill at or billcole at
(AKA @grumpybozo and many * addresses)
Not Currently Available For Hire

More information about the macports-users mailing list