Re: [PATCH] Expose port->authn_id to extensions and triggers - Mailing list pgsql-hackers

From Andres Freund
Subject Re: [PATCH] Expose port->authn_id to extensions and triggers
Date
Msg-id 20220225212349.gf76klktl4dmm5ah@alap3.anarazel.de
Whole thread Raw
In response to Re: [PATCH] Expose port->authn_id to extensions and triggers  (Jacob Champion <pchampion@vmware.com>)
Responses Re: [PATCH] Expose port->authn_id to extensions and triggers  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
On 2022-02-25 20:19:24 +0000, Jacob Champion wrote:
> From 2fde60a6bc3739f1894c8c264120e4fa0f04df64 Mon Sep 17 00:00:00 2001
> From: Jacob Champion <pchampion@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



pgsql-hackers by date:

Previous
From: Chapman Flack
Date:
Subject: Re: [PATCH] pg_permissions
Next
From: Andres Freund
Date:
Subject: Re: [PATCH] Expose port->authn_id to extensions and triggers