Re: [PROPOSAL] Client Log Output Filtering - Mailing list pgsql-hackers

From Petr Jelinek
Subject Re: [PROPOSAL] Client Log Output Filtering
Date
Msg-id 56E1A981.5080702@2ndquadrant.com
Whole thread Raw
In response to Re: [PROPOSAL] Client Log Output Filtering  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 10/03/16 17:07, Tom Lane wrote:
> Petr Jelinek <petr@2ndquadrant.com> writes:
>> The comment above errhidefromclient says "Only log levels below ERROR
>> can be hidden from the client." but use of the errhidefromclient(true)
>> actually does hide the error message from client, client just gets
>> failed query without any message when used with ERROR level.
>
> Um.  That seems pretty broken --- I think it's a violation of the wire
> protocol spec.
>

I was thinking that as well. The doc says that on error the 
ErrorResponse is sent and connection is closed and we clearly fail to 
send the ErrorResponse in this case.

> I notice though that we allow client_min_messages to be set to FATAL,
> which would be a different way of violating the protocol.  Maybe we
> should reduce the max setting of that to ERROR?
>

Hmm yeah that seems to be that way for very long time though so I wonder 
if that's intentional although it's also against protocol spec then. In 
any case I would be in favor of lowering the max setting to ERROR.

For the patch at hand, it should be sufficient for errhidefromclient() 
to check that the edata->elevel is lower than ERROR.

--   Petr Jelinek                  http://www.2ndQuadrant.com/  PostgreSQL Development, 24x7 Support, Training &
Services



pgsql-hackers by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Add generate_series(date,date) and generate_series(date,date,integer)
Next
From: Tom Lane
Date:
Subject: Re: Optimizer questions