Re: [PATCH] Expose port->authn_id to extensions and triggers

Jacob Champion <jchampion@timescale.com>

From: Jacob Champion <jchampion@timescale.com>
To: "Drouvot, Bertrand" <bdrouvot@amazon.com>, Michael Paquier <michael@paquier.xyz>
Cc: Joe Conway <mail@joeconway.com>, Robert Haas <robertmhaas@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, "sfrost@snowman.net" <sfrost@snowman.net>, "rjuju123@gmail.com" <rjuju123@gmail.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>, "andres@anarazel.de" <andres@anarazel.de>
Date: 2022-08-23T17:04:30Z
Lists: pgsql-hackers
On 8/23/22 01:53, Drouvot, Bertrand wrote:
> That sounds all good to me, except a typo for the author in the commit 
> message: s/Jocob/Jacob/

Thanks, I missed that on my readthrough! :D

Patch looks good to me, too, with one question:

> @@ -2688,6 +2689,7 @@ InitProcessGlobals(void)                                   
>     MyProcPid = getpid();                                                        
>     MyStartTimestamp = GetCurrentTimestamp();                                    
>     MyStartTime = timestamptz_to_time_t(MyStartTimestamp);                       
> +   memset(&MyClientConnectionInfo, 0, sizeof(MyClientConnectionInfo));          
>                                                                                  
>     /*                                                                           
>      * Set a different global seed in every process.  We want something 

When can we rely on static initialization, and when can't we? Is there a
concern that the memory could have been polluted from before the
postmaster's fork?

Thanks,
--Jacob



Commits

  1. Remove initialization of MyClientConnectionInfo at backend startup

  2. Allow parallel workers to retrieve some data from Port