Re: Improvement to psql's connection defaults

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Improvement to psql's connection defaults
Дата
Msg-id 16720.1576505826@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Improvement to psql's connection defaults  (Tomas Zubiri <me@tomaszubiri.com>)
Ответы Re: Improvement to psql's connection defaults  (Tomas Zubiri <me@tomaszubiri.com>)
Список pgsql-hackers
Tomas Zubiri <me@tomaszubiri.com> writes:
> The problem was that running the command psql without arguments
> returned the following
> error message:
> psql: could not connect to server: No such file or directory
>     Is the server running locally and accepting
>     connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

The reason this failed, most likely, is using a semi-broken installation
in which libpq has a different idea than the server of where the
unix socket should be.  The right fix is one or the other of

(a) don't mix-and-match Postgres packages from different vendors,

(b) adjust the server's unix_socket_directories parameter so that
it creates a socket where your installed libpq expects to find it.

I realize that this isn't great from a newbie-experience standpoint,
but unfortunately we don't have a lot of control over varying
packager decisions about the socket location --- both the "/tmp"
and the "/var/run/postgresql" camps have valid reasons for their
choices.

I do not think your proposal would improve matters; it'd just introduce
yet another variable, ie which transport method did libpq choose.
As Christoph noted, that affects authentication behaviors, and there
are a bunch of other user-visible impacts too (SSL, timeouts, ...).

If we were going to do something of this sort, what I'd be inclined
to think about is having an option to probe both of the common socket
directory choices, rather than getting into TCP-land.  But that still
might be a net negative from the standpoint of confusion vs. number of
cases it fixes.

            regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Laurenz Albe
Дата:
Сообщение: Re: Request to be allotted a project or a feature in pipeline
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Improvement to psql's connection defaults