Re: [oauth] Bug: when is shutdown_cb called? - Mailing list pgsql-hackers

From Jacob Champion
Subject Re: [oauth] Bug: when is shutdown_cb called?
Date
Msg-id CAOYmi+ncsyQiODCv+7-EnQ4pTd7NuZhKV7s+_m7QGCMe4HfH9A@mail.gmail.com
Whole thread
In response to [oauth] Bug: when is shutdown_cb called?  (Zsolt Parragi <zsolt.parragi@percona.com>)
Responses Re: [oauth] Bug: when is shutdown_cb called?
Re: [oauth] Bug: when is shutdown_cb called?
List pgsql-hackers
On Wed, Feb 18, 2026 at 4:50 AM Zsolt Parragi <zsolt.parragi@percona.com> wrote:
> Maybe we should just fix the documentation instead?

Yeah, this is just a docs bug. It changed in v47 of the original
patchset [1] but I forgot to update the documentation. (It was
originally a before_shmem_exit implementation, which is why that fits
the description well. :D)

I propose the attached diff, with a backport to 18.

> The advantages: things like expiration checks[2], or repeated
> validation in the future when we implement token refresh need a
> working validator state, which means either we have to call
> startup/shutdown multiple times, or keep the context.

Personally I think it's fine for more complicated behavior to require
more integration into the existing server APIs. We don't need to
reinvent OAuth-specific wheels; implementations will just need to pay
attention to memory contexts and _PG_init like standard extensions
already do.

Thanks,
--Jacob

[1] https://www.postgresql.org/message-id/CAOYmi%2BnHG7oy%2BybHH72WjiXAQG3tE6v_at-K9ebRy2oqo92V%2BA%40mail.gmail.com

Attachment

pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Make copyObject work in C++
Next
From: Fujii Masao
Date:
Subject: Re: doc: Clarify that empty COMMENT string removes the comment