Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vydul-000I0r-1A for pgsql-hackers@arkaria.postgresql.org; Fri, 06 Mar 2026 22:44:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vyduj-007EVs-1c for pgsql-hackers@arkaria.postgresql.org; Fri, 06 Mar 2026 22:44:57 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vyduj-007EVk-0f for pgsql-hackers@lists.postgresql.org; Fri, 06 Mar 2026 22:44:57 +0000 Received: from mail-yx1-xb135.google.com ([2607:f8b0:4864:20::b135]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vydug-00000001GDZ-2TTS for pgsql-hackers@postgresql.org; Fri, 06 Mar 2026 22:44:57 +0000 Received: by mail-yx1-xb135.google.com with SMTP id 956f58d0204a3-64ad79df972so9307165d50.1 for ; Fri, 06 Mar 2026 14:44:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1772837093; cv=none; d=google.com; s=arc-20240605; b=feeSyWBrm8mN/wLAZnNRvc43lKA1+spEc2iOG3lypsPMblV1mJclKyEHqTHuPyq7kP O6iSxhpP8/gj5DCQaOFMNH/eEtx3JyWq4JBlOFKohMj1jmu+DGYUBsBC93cNpOo6/hRO /kW3lC5dCSGqXteruwVxnVXMpHpHMevdZsPSoEKu41tG1cvqaLQStq0Su3WxYOXa/Czp z5RuPNwE6mt9QkXb7AXHmphQ/EzRO/rR2wk6GPwtwDU4+4Xmt4/JWOoXtAB06vQqftlD FXrESMV71sx9jIJct5QyDmbebVRKz1VIcLuHXkEAHQp+8aZbBXvMcHmmyEmBhVnJlDjU ab4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=DOCIVOBBcu7srdmdblcCvuKKPN3uJ9P25bwbDwnzp8w=; fh=Nw64H9N69w52pCIo08CfTLELAn0SlP65TqydhNJLFIo=; b=XiwiaCEwTBYZ0Fiujy9KDJm4hxq+0UOfP9POtVCbaP+tvWQXUVWliHyWC3GrLD9rBw 6l3u8WlYdmdJ2AKhc6GPyWJkCpv2jpqZh+WewrYtdlMchGNkdXgIPLg/0kykA6zIAnGh 89d1DU+YN9A9MMSeB78ynM+VO3OjN+Sh8N2+XZtBdBM+/wMSr5E2Xok2sq5gJ1RMgjf9 nt8LQy2HV/7XJHfyxkdoX8EsiSV1mIaiEAsuz+EmMsqKRh8ir8UWbUHYJonPuu4Xxi2v 0a6EZ4O9FrPlDEF5fUFie/mfmLE7H/RTVlWd8T2Sc0N2TldgNtBFgnMHxJEMZAyfAORT 8Rjg==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=percona.com; s=google; t=1772837093; x=1773441893; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=DOCIVOBBcu7srdmdblcCvuKKPN3uJ9P25bwbDwnzp8w=; b=hjLE6z2a11BMP2+2e4iY5foR9T7h+U5mBf2ozSGKdDx4kXpcfCW82W+DmmPIGTKMX5 HAUlWg/4YzsaetbPlWv5+z6RErI5WlGaItRt6MFRqMigO3PRjYaah75woyqjqsPyNHdB PT4zfN8xjwujnAjQopsnki+L6HDb17lgC3irU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772837093; x=1773441893; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=DOCIVOBBcu7srdmdblcCvuKKPN3uJ9P25bwbDwnzp8w=; b=OIRj+G6qtjzQXU6vWHVAXoMXWf7UMgey8yH5zj7dYT+Z5lJ/cJjg3ucJx7HdaexyFS 6Bg72yPTyhwUQ46QNbWcjuwLMxihd5EuRugWc/b7EhceUDv6RWtHc2mGjZSz25jrW1uF R0jGtIVkUeuIT7yBnwxhZETM3Q9yZ3UuBfhKIPyTT2neuLQnXqGzq58UqOd1hpvVtUvY inf0AAsMX2YhV+oI+b44hmF9dsinDfVRbUXc+DfdD2cvB5vlNBWnvdCnGFK1rL7CLeY4 dkq4xzJJuh0HndB3y7MpogH8MKC/53YHEVhtssuBZeks/ou8XlJU+1mZC1T/mAIfiKmQ QK+w== X-Gm-Message-State: AOJu0YyG14Ua/zL7i/jSmpTOOWUpF5TvYSZaUBcglVsjaPRSWN3Ac2gW sgICFIjKndhp925+hIJCZGP0eH9Mj46gGw4s73Cj96UEcRIbezZ4PGZl7PWAavaHLvnW1CnnHIl zZhHoXYzQvlrBgYS8zQSIhHVQO0oVNCyq0PAiLqepSXHhlxnjnWlt7J5HKxHflu2+Xtnbh8aN+U T8zGL3fhcICMquuO0f/Glptbqb8fpT08zwyP9Yh08bpmxWCMQxPINlmXSupwDI/NmJitQrBr9dj 5ephyejjR3YQ213zgyy18YG3HLnCm1VHKNtG5m1VTjq+KoeoL4= X-Gm-Gg: ATEYQzyrTueS/KXHLki8EPecsHPialZvQgkNzgAsUwC4SCAjyDLCbDYpZkEUJPjOvKD v98T025Zrj/6Ttxuj+3csp8om6z4y1LyoraLZV1lxeDX1znn/SncaoHdVtfzUNAlMchcj6NRett Lnz2SiSKtj8r3lABV7nqSenjJFbHoNPjyBjYLxnjEJHWkATefsZ+2Efvqo0ySNW58G3LlaJZUSo Cd4DsEeWoj9swor9fiAEAOcviwAkUATS5OOpNouhbetkAtnbZE6G0SNwulhOjj/U9N3XHwxcARR JytkWvXTstvWeat+yD0agPXStDMvTNBb+E6tTdL03O1LVjseNwD8SnI5DXJ03V8/DvKZ X-Received: by 2002:a05:690c:398:b0:798:270:fec0 with SMTP id 00721157ae682-798dd68a7cdmr33639307b3.5.1772837093058; Fri, 06 Mar 2026 14:44:53 -0800 (PST) MIME-Version: 1.0 References: <3720B2E1-0B96-4063-8D63-B5AE6AFEA159@gmail.com> In-Reply-To: From: Zsolt Parragi Date: Fri, 6 Mar 2026 22:44:43 +0000 X-Gm-Features: AaiRm51tft8FcB66GmzocvvD2xuUakYeUd1JPZj2aE6O4FlWaeaa-DQQLup7e6k Message-ID: Subject: Re: [oauth] Stabilize the libpq-oauth ABI (and allow alternative implementations?) To: Jacob Champion Cc: PostgreSQL Hackers , Chao Li Content-Type: text/plain; charset="UTF-8" X-CLOUD-SEC-AV-Sent: true X-CLOUD-SEC-AV-Info: percona,google_mail,monitor X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk For the first commits I only have a few more questions/comments about the error messages, otherwise looks good. > > + libpq_append_conn_error(conn, "failed to lock mutex (%d)", lockerr); > > + return 0; > > + } > > Shouldn't this path return -1, > > We could. I chose zero to try to retain the PG18 behavior, but I could > expand this error message and set request->error instead. If that'd be > less confusing to you as a reader, it's probably worth the change. If this returns 0, we print out failed to lock mutex no OAuth flows are available (try installing the libpq-oauth package) Which isn't ideal, as the library is there, so installing the package wouldn't help. + 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. The more detailed message is only printed out with unsafe debugging, without that it just returns 0. + 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. (or shouldn't it use "internal error:" similarly to the other untranslated error message? and another 2 internal errors are translated) > (try installing the libpq-oauth package) This isn't changed in these patches, but Is it okay to assume a package name here? This is not a package that universally exists everywhere, we can't even be sure that pg was installed with a package manager. On RHEL it is called postgresql18-libs-oauth, on suse it's part of the main libpq package. In both cases if for some internal error it can't find/load the library, we suggest installing a package that doesn't exist on that system.