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

From Jacob Champion
Subject [PATCH] Expose port->authn_id to extensions and triggers
Date
Msg-id 793d990837ae5c06a558d58d62de9378ab525d83.camel@vmware.com
Whole thread Raw
Responses Re: [PATCH] Expose port->authn_id to extensions and triggers
List pgsql-hackers
Hi all,

Stephen pointed out [1] that the authenticated identity that's stored
in MyProcPort can't be retrieved by extensions or triggers. Attached is
a patch that provides both a C API and a SQL function for retrieving
it.

GetAuthenticatedIdentityString() is a mouthful but I wanted to
differentiate it from the existing GetAuthenticatedUserId(); better
names welcome. It only exists as an accessor because I wasn't sure if
extensions outside of contrib were encouraged to rely on the internal
layout of struct Port. (If they can, then that call can go away
entirely.)

Thanks,
--Jacob

[1] https://www.postgresql.org/message-id/CAOuzzgpFpuroNRabEvB9kST_TSyS2jFicBNoXvW7G2pZFixyBw%40mail.gmail.com

Attachment

pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: convert libpq uri-regress tests to tap test
Next
From: Joseph Koshakow
Date:
Subject: Extract epoch from Interval weird behavior