Re: [oauth] Stabilize the libpq-oauth ABI (and allow alternative implementations?)

From: Jacob Champion <jacob(dot)champion(at)enterprisedb(dot)com>
To: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
Subject: Re: [oauth] Stabilize the libpq-oauth ABI (and allow alternative implementations?)
Date: 2026-03-07 00:27:12
Message-ID: CAOYmi+mLaohk3FLbH9fKGmzN7yFGHs2Zefdyp31wbL1130puiA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Mar 6, 2026 at 2:44 PM Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com> wrote:
> + if ((start_flow = dlsym(state->flow_module, "pg_start_oauthbearer")) == NULL)
>
> And this path has the same issue, the library is there, so suggesting
> to install libpq-oauth isn't helpful.

I'll cherry-pick some of the -1 handling backwards in the patchset to
handle this.

> + appendPQExpBuffer(&conn->errorMessage,
> + "use_builtin_flow: failed to lock mutex (%d)\n",
> + lockerr);
>
> This is after an assert, so maybe it is okay as is, but this bypasses
> gettext.

Correct. For PG18, I got the feedback that can't-happen errors in
OAuth should really remain untranslated, unless it's clear that the
user can act on them. Otherwise we're consuming translators' time for
no practical benefit.

> > (try installing the libpq-oauth package)
>
> This isn't changed in these patches, but Is it okay to assume a
> package name here?

No, not really, but see [1]. Any "vanilla" version of that error
message will contain the string "libpq-oauth" regardless; that's the
module's name. So package maintainers need to either patch the line if
it's not useful, or else let us know how they'd prefer to override
this -- Makefile? Configure? (Meson?) -- to improve the situation.
Christoph gave the most feedback here, so Debian has the most-greased
wheel at the moment. :D

Thanks,
--Jacob

[1] https://postgr.es/m/aAOREVWMFTuWvJ1l%40msg.df7cb.de

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message George Tarasov 2026-03-07 00:28:14 [BUG?] missing array index may result in a wrong constraint name (pg_dump, bin-upgrade, >=18)
Previous Message Matt Blewitt 2026-03-07 00:26:53 Re: [PATCH] Fix PITR pause bypass when initial XLOG_RUNNING_XACTS has subxid overflow