Re: Introduce "log_connection_stages" setting. - Mailing list pgsql-hackers

From Jacob Champion
Subject Re: Introduce "log_connection_stages" setting.
Date
Msg-id 6703cce8-25fe-8195-5865-1825b7f59087@timescale.com
Whole thread Raw
In response to Re: Introduce "log_connection_stages" setting.  (Sergey Dudoladov <sergey.dudoladov@gmail.com>)
Responses Re: Introduce "log_connection_stages" setting.  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 2/1/23 11:59, Sergey Dudoladov wrote:
> Justin, thank you for the fast review. The new version is attached.

This is looking very good. One bigger comment:

> +    myextra = (int *) guc_malloc(ERROR, sizeof(int));
> +    *myextra = newlogconnect;

If I've understood Tom correctly in [1], both of these guc_mallocs
should be using a loglevel less than ERROR, to avoid forcing a
postmaster exit when out of memory. (I used WARNING in that thread
instead, which seemed to be acceptable.)

And a couple of nitpicks:

> +        Causes the specified stages of each connection attempt to the server to be logged. Example:
<literal>authorized,disconnected</literal>.

Long line; should be rewrapped.

> +       else {                                                                   
> +           GUC_check_errcode(ERRCODE_INVALID_PARAMETER_VALUE);                  
> +           GUC_check_errmsg("invalid value '%s'", stage);                       
> +           GUC_check_errdetail("Valid values to use in the list are 'all', 'received', 'authenticate
> +           " If 'all' is present, it must be the only value in the list."); 

I think the errmsg here should reuse the standard message format
    invalid value for parameter "%s": "%s"
both for consistency and ease of translation.

Thanks!
--Jacob

[1] https://www.postgresql.org/message-id/2012342.1658356951%40sss.pgh.pa.us



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Documentation of psql's \df no longer matches reality
Next
From: Andrew Dunstan
Date:
Subject: Re: buildfarm + meson