Subject: pgsql: doc: Clarify OAuth validator authn_id logging

From: Daniel Gustafsson <[email-masked]>
Date: Fri, 05 Jun 2026 22:22:05 +0000

doc: Clarify OAuth validator authn_id logging

Document that OAuth validators can return an authenticated identity
in the authn_id member.  The server records the identity value before
checking if the connection is authorized, so it may appear in
connection-authentication logs (even if the connection later fails
authorization).

Also remove outdated wording saying that all result parameters are
ignored when a validator returns false since validators may provide
error_detail.

Patch by Chao Li with some additional wordsmithing by me.

Author: Chao Li <[email-masked]>
Reviewed-by: Jacob Champion <[email-masked]>
Reported-by: Daniel Gustafsson <[email-masked]>
Discussion: https://postgr.es/m/[email-masked]

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/4cb2e2fe0aa8251bef8c2e2351cd5a062c105c0a

Modified Files
--------------
doc/src/sgml/oauth-validators.sgml | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)

---

From: Erik Rijkers <[email-masked]>
Date: Sat, 6 Jun 2026 14:36:24 +0200

> https://git.postgresql.org/pg/commitdiff/4cb2e2fe0aa8251bef8c2e2351cd5a062c105c0a

Hi,

In doc/src/sgml/oauth-validators.sgml, and if I understand this text 
correctly (always a big if), then:

"If the validator returns true and set result->authn_id then"

should be:
"If the validator returns true and sets result->authn_id then"
   (i.e., set -> sets)

(added Michael in CC as he seems to collect these minimal patches, to be 
committed later as a group)

Thanks,

Erik

---

From: Michael Paquier <[email-masked]>
Date: Mon, 8 Jun 2026 08:56:04 +0900

> committed later as a group)

In auth-oauth.c, there is a validate() path setting the authn_id, so
your suggestion sounds right.  I've grabbed that for later.  My branch
can always be overwritten by somebody else's commit preference, of
course, so if you feel that this should be fixed separately, feel free
to go ahead.
--
Michael