postgresql/src/backend/utils
Tom Lane 041ad9a66d Disallow setting client_min_messages higher than ERROR.
Previously it was possible to set client_min_messages to FATAL or PANIC,
which had the effect of suppressing transmission of regular ERROR messages
to the client.  Perhaps that seemed like a useful option in the past, but
the trouble with it is that it breaks guarantees that are explicitly made
in our FE/BE protocol spec about how a query cycle can end.  While libpq
and psql manage to cope with the omission, that's mostly because they
are not very bright; client libraries that have more semantic knowledge
are likely to get confused.  Notably, pgODBC doesn't behave very sanely.
Let's fix this by getting rid of the ability to set client_min_messages
above ERROR.

In HEAD, just remove the FATAL and PANIC options from the set of allowed
enum values for client_min_messages.  (This change also affects
trace_recovery_messages, but that's OK since these aren't useful values
for that variable either.)

In the back branches, there was concern that rejecting these values might
break applications that are explicitly setting things that way.  I'm
pretty skeptical of that argument, but accommodate it by accepting these
values and then internally setting the variable to ERROR anyway.

In all branches, this allows a couple of tiny simplifications in the
logic in elog.c, so do that.

Also respond to the point that was made that client_min_messages has
exactly nothing to do with the server's logging behavior, and therefore
does not belong in the "When To Log" subsection of the documentation.
The "Statement Behavior" subsection is a better match, so move it there.

Jonah Harris and Tom Lane

Discussion: https://postgr.es/m/7809.1541521180@sss.pgh.pa.us
Discussion: https://postgr.es/m/15479-ef0f4cc2fd995ca2@postgresql.org
2018-11-08 17:33:26 -05:00
..
adt Avoid statically allocating gmtsub()'s timezone workspace. 2018-10-16 11:50:19 -04:00
cache Limit depth of forced recursion for CLOBBER_CACHE_RECURSIVELY. 2018-09-07 18:14:24 -04:00
error Disallow setting client_min_messages higher than ERROR. 2018-11-08 17:33:26 -05:00
fmgr Add a utility function to extract variadic function arguments 2017-10-25 07:19:59 -04:00
hash Remove broken and useless entry-count printing in HASH_DEBUG code. 2017-08-02 12:16:57 -04:00
init Initialize random() in bootstrap/stand-alone postgres and in initdb. 2018-09-23 22:56:42 -07:00
mb Don't call pgwin32_message_to_UTF16() without CurrentMemoryContext. 2017-11-12 13:03:28 -08:00
misc Disallow setting client_min_messages higher than ERROR. 2018-11-08 17:33:26 -05:00
mmgr Handle elog(FATAL) during ROLLBACK more robustly. 2017-08-14 15:43:20 -04:00
resowner pgindent run for 9.6 2016-06-09 18:02:36 -04:00
sort Fix actual and potential double-frees around tuplesort usage. 2018-03-28 13:26:43 -04:00
time Fix pruning of locked and updated tuples. 2017-12-14 18:20:48 -08:00
.gitignore Avoid maintaining three separate copies of the error codes list. 2011-02-03 22:32:49 -05:00
errcodes.txt Add the "snapshot too old" feature 2016-04-08 14:36:30 -05:00
Gen_dummy_probes.pl Finish pgindent run for 9.6: Perl files. 2016-06-12 04:19:56 -04:00
Gen_dummy_probes.sed Update copyright for 2016 2016-01-02 13:33:40 -05:00
Gen_fmgrtab.pl Update copyright for 2016 2016-01-02 13:33:40 -05:00
generate-errcodes.pl Update copyright for 2016 2016-01-02 13:33:40 -05:00
Makefile Fix make rules that generate multiple output files. 2018-03-23 13:45:38 -04:00
probes.d Update copyright for 2016 2016-01-02 13:33:40 -05:00