Re: Select works only when connected from login postgres - Mailing list pgsql-general

From Tom Lane
Subject Re: Select works only when connected from login postgres
Date
Msg-id 26569.1480873909@sss.pgh.pa.us
Whole thread Raw
In response to Re: Select works only when connected from login postgres  (Joseph Brenner <doomvox@gmail.com>)
Responses Re: Select works only when connected from login postgres
List pgsql-general
Joseph Brenner <doomvox@gmail.com> writes:
>> So what happens when you specify the port in your psql connection, eg:
>> /usr/local/pgsql/bin/psql --dbname=doom --username=doom -p 5432
>> /usr/local/pgsql/bin/psql --dbname=doom --username=doom -p 5433
>> /usr/local/pgsql/bin/psql --dbname=doom --username=doom -p 5434

> With /usr/local/pgsql/bin/psql, only "-p 5433" connects, the
> other two complain like so:

>   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.5434"?

What this probably indicates is that the other two installations are
configured to put their socket files someplace else than /tmp, perhaps
/var/run/postgresql.  Connecting to them and issuing "show
unix_socket_directories" would tell the tale.

You can persuade a psql to connect to a socket in a nondefault directory
by giving the directory name as host, eg

psql --host=/var/run/postgresql -p 5434

It would be interesting to try all nine combinations of the psql's
supplied by your various installations and the servers, just to confirm
which ones behave normally and which don't.  Of course, the other two
would have to be told --host=/tmp to talk to the handbuilt server.

            regards, tom lane


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: count(*) in binary mode returns 0
Next
From: Adrian Klaver
Date:
Subject: Re: Postgres and LibreOffice's 'Base'