unknown libpq service entries ignored

Поиск
Список
Период
Сортировка
Искать

unknown libpq service entries ignored

От:
Peter Eisentraut <peter_e@gmx.net>
Дата:
When using the "service" parameter in a libpq connection (e.g., psql
service=foo), and the service name is not defined in pg_service.conf,
then the setting is silently ignored and the connection proceeds with
whatever other settings and defaults apply.  That does not look very
robust.  Shouldn't there be an error when a specified service name does
not exist?


Re: unknown libpq service entries ignored

От:
"Albe Laurenz" <laurenz.albe@wien.gv.at>
Дата:
Peter Eisentraut wrote:
> When using the "service" parameter in a libpq connection (e.g., psql
> service=foo), and the service name is not defined in pg_service.conf,
> then the setting is silently ignored and the connection proceeds with
> whatever other settings and defaults apply.  That does not look very
> robust.  Shouldn't there be an error when a specified service name does
> not exist?

I agree. It leads to strange error messages at least (I didn't want
to connect to port 5432 on localhost?!?), and you could end up
connecting to a different database than you wanted without
noticing it.

Yours,
Laurenz Albe

Re: unknown libpq service entries ignored

От:
Peter Eisentraut <peter_e@gmx.net>
Дата:
Вложения:
On tor, 2009-11-26 at 10:57 +0200, Peter Eisentraut wrote:
> When using the "service" parameter in a libpq connection (e.g., psql
> service=foo), and the service name is not defined in pg_service.conf,
> then the setting is silently ignored and the connection proceeds with
> whatever other settings and defaults apply.  That does not look very
> robust.  Shouldn't there be an error when a specified service name does
> not exist?

Possible patch for this issue.

Re: unknown libpq service entries ignored

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Peter Eisentraut  writes:
> +		printfPQExpBuffer(errorMessage,
> +						  libpq_gettext("ERROR: service \"%s\" not found\n"), service);

Please make the message consistent with the rest of libpq.  AFAICS none
of the other messages in that file use an ERROR: prefix.
		regards, tom lane

Re: unknown libpq service entries ignored

От:
Peter Eisentraut <peter_e@gmx.net>
Дата:
On fre, 2009-11-27 at 10:22 -0500, Tom Lane wrote:
> Peter Eisentraut  writes:
> > +		printfPQExpBuffer(errorMessage,
> > +						  libpq_gettext("ERROR: service \"%s\" not found\n"), service);
> 
> Please make the message consistent with the rest of libpq.  AFAICS none
> of the other messages in that file use an ERROR: prefix.

Well, that style is used four times in that same function, but no where
else in the file.  So the existing uses should probably also be cleaned
up.


FAQ