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

Started by Magnus Haganderover 17 years ago4 messagescomitters
Jump to latest
#1Magnus Hagander
magnus@hagander.net

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)

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Magnus Hagander (#1)
Re: pgsql: Log a warning instead of shutting down the system if we can't

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

#3Magnus Hagander
magnus@hagander.net
In reply to: Tom Lane (#2)
Re: pgsql: Log a warning instead of shutting down the system if we can't

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

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Magnus Hagander (#3)
Re: pgsql: Log a warning instead of shutting down the system if we can't

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