On 2022-02-25 20:19:24 +0000, Jacob Champion wrote: > From 2fde60a6bc3739f1894c8c264120e4fa0f04df64 Mon Sep 17 00:00:00 2001 > From: Jacob Champion <pchamp...@vmware.com> > Date: Mon, 14 Feb 2022 08:10:53 -0800 > Subject: [PATCH v3] Add API to retrieve authn_id from SQL
> The authn_id field in MyProcPort is currently only accessible to the > backend itself. Add a SQL function, session_authn_id(), to expose the > field to triggers that may want to make use of it. Looks to me like authn_id isn't synchronized to parallel workers right now. So the function will return the wrong thing when executed as part of a parallel query. I don't think we should add further functions not prefixed with pg_. Perhaps a few tests for less trivial authn_ids could be worthwhile? E.g. certificate DNs. Greetings, Andres Freund