Disallow setting client_min_messages > ERROR?
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-hackers@lists.postgresql.org
Date: 2018-11-06T16:19:40Z
Lists: pgsql-hackers
There's a thread on the ODBC list[1] complaining about the fact that
it's possible to set client_min_messages to FATAL or PANIC, because
that makes ODBC misbehave. This is not terribly surprising, because
doing so arguably breaks the frontend protocol. The simple-query
section says this:
In the event of an error, ErrorResponse is issued followed by
ReadyForQuery.
and the extended-query section says this:
Therefore, an Execute phase is always terminated by the appearance of
exactly one of these messages: CommandComplete, EmptyQueryResponse (if
the portal was created from an empty query string), ErrorResponse, or
PortalSuspended.
and both of those are lies if an ERROR response gets suppressed thanks to
client_min_messages being set too high. It seems that libpq+psql manages
to survive the case (probably because psql is too stupid to notice that
anything is wrong), but I don't find it unreasonable that other clients
get hopelessly confused.
Hence, I propose that we should disallow setting client_min_messages
any higher than ERROR, and that this probably even amounts to a
back-patchable bug fix.
Thoughts?
regards, tom lane
[1] https://www.postgresql.org/message-id/flat/EE586BE92A4AFB45B03310C2A0C0565D6D0EFC17%40G01JPEXMBKW03
Commits
-
Disallow setting client_min_messages higher than ERROR.
- c09daa910409 10.7 landed
- 7b08b4a8adbb 11.2 landed
- 3d360e20c9ae 12.0 landed
- 88275ac19900 9.5.16 landed
- 2407d4807fdc 9.4.21 landed
- 041ad9a66d28 9.6.12 landed