Обсуждение: pgsql: Log a warning instead of shutting down the system if we can't

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

pgsql: Log a warning instead of shutting down the system if we can't

От
mha@postgresql.org (Magnus Hagander)
Дата:
Log Message:
-----------
Log a warning instead of shutting down the system if we can't load
pg_hba.conf on reload (for example due to a permission error).

Selena Deckelmann

Modified Files:
--------------
    pgsql/src/backend/libpq:
        hba.c (r1.180 -> r1.181)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/libpq/hba.c?r1=1.180&r2=1.181)

Re: pgsql: Log a warning instead of shutting down the system if we can't

От
Tom Lane
Дата:
mha@postgresql.org (Magnus Hagander) writes:
> Log a warning instead of shutting down the system if we can't load
> pg_hba.conf on reload (for example due to a permission error).

This should be elog(LOG), not elog(WARNING).  Compare the treatment
of syntax errors within the file.

            regards, tom lane

Re: pgsql: Log a warning instead of shutting down the system if we can't

От
Tom Lane
Дата:
Magnus Hagander <magnus@hagander.net> writes:
> Tom Lane wrote:
>> This should be elog(LOG), not elog(WARNING).  Compare the treatment
>> of syntax errors within the file.

> While I can agree that they should be the same, why should they not be
> WARNING?

Because the postmaster has no client to receive a WARNING, and the log
message level is likely to be such that a WARNING won't get there
either.  Furthermore, if there are any live backends that might chance
to issue this message, having it pop up as a WARNING seems more likely
to be confusing than helpful, since it'll be unrelated to whatever SQL
command they are doing.

In general, LOG elevel should be used for background-type problems,
which is what this is.

            regards, tom lane

Re: pgsql: Log a warning instead of shutting down the system if we can't

От
Magnus Hagander
Дата:
Tom Lane wrote:
> mha@postgresql.org (Magnus Hagander) writes:
>> Log a warning instead of shutting down the system if we can't load
>> pg_hba.conf on reload (for example due to a permission error).
>
> This should be elog(LOG), not elog(WARNING).  Compare the treatment
> of syntax errors within the file.

While I can agree that they should be the same, why should they not be
WARNING?

//Magnus