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

From David Steele
Subject [PROPOSAL] Client Log Output Filtering
Date
Msg-id 5655B621.3080906@pgmasters.net
Whole thread Raw
Responses Re: [PROPOSAL] Client Log Output Filtering  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
Currently log messages generated by pgaudit can be made visible to the
client simply by altering client_min_messages.  While this has not been
a showstopper for anyone it's ideal, either.

The client authentication code sets the global variable
ClientAuthInProgress which causes ereport() to filter client output <
ERROR while forcing client output >= ERROR.  This functionality would
also work well for pgaudit.

The patch creates a new counter to separate the log filtering from the
authentication functionality.  This makes it possible to get the same
filtering in other parts of the code (or extensions) without abusing the
ClientAuthInProgress variable or using the log hook.

I also considered a new function for ereport (like errhidecontext()) but
this mechanism would not have worked for authentication and so would not
have been used anywhere in core.

If there are no objections I'll submit it to the next commitfest.

--
-David
david@pgmasters.net

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Re: In-core regression tests for replication, cascading, archiving, PITR, etc.
Next
From: Michael Paquier
Date:
Subject: Re: pageinspect patch, for showing tuple data