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 1viG3m-001kql-1b for pgsql-hackers@arkaria.postgresql.org; Tue, 20 Jan 2026 18:02:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1viG3l-002BN5-1y for pgsql-hackers@arkaria.postgresql.org; Tue, 20 Jan 2026 18:02:33 +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 1viG3l-002BMs-0k for pgsql-hackers@lists.postgresql.org; Tue, 20 Jan 2026 18:02:33 +0000 Received: from mail-ua1-x935.google.com ([2607:f8b0:4864:20::935]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1viG3i-001Z4h-1T for pgsql-hackers@lists.postgresql.org; Tue, 20 Jan 2026 18:02:32 +0000 Received: by mail-ua1-x935.google.com with SMTP id a1e0cc1a2514c-94130b88642so3462985241.3 for ; Tue, 20 Jan 2026 10:02:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1768932148; cv=none; d=google.com; s=arc-20240605; b=aFK7Gf/Icph40aMkXpyrb1Y6mem5MMNNspEOfyhx9STQQJmGTGms9tE6JkY5M9H3m4 95aPAJjXCX5bbetBBxIhpptokxybK4vaIIQ2D6jELGJ0+IAiLAPmOhIaicBOQiCCk0X2 3d4J3CQ6CKp3f6pqadvu1pAglww3cP6nakTugpP+7CfTj807VlONFAMHqp8x1n0ofgXS sbme08EPoa6qL+BDIQ6PgG9wb8JcWKr8DpLWF0vNVdxZu1QbdctG8VPaoeEZAhD4CxLH WDTrmU+8dHx6/cm2R7QRJwwLUbKdIU/3ncsvhBxPQFGrs+x364dOFzNW1yecAKdOMovY UbfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=JnKPDRaAaWTl6tAgPx6C0e7LZiF9HhBKM2aTvFhAj90=; fh=QoxAydRAj8ooW3v7hgHeiO5mvrgNRa2dDxdmTrk3ItI=; b=O2xCyYwYxcJxnFl15OLtrYYXybr5SWJjJ71ILlAvJafIVPtjUO/qOy/ZqpzC31DZYA zcXlkTPy0VuE1IzJocBPO7w+heXitr5zKZNrKgx0EmiLn6YOMwTawWzsHO6XUL9/Dy1W JDN8oVaCsw0FW/c75REpmLlJ0i1zFdaJW9RRh9kn5LSJodrLnk81fC5uz6OvvpK34q4A aUbQtYVPU73TJlhSjRcbrgu/Xkn9NFN5UEtR/gSOFC20tuoLOLR0sf5/oO7XcIyE5xZN T2lZEBSrktH8/MsYTQ+FTBLTg7rICt1bGqnYoI8gCfF4572upCClOSSFfeFcRnEHSVfu 6Esw==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1768932148; x=1769536948; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=JnKPDRaAaWTl6tAgPx6C0e7LZiF9HhBKM2aTvFhAj90=; b=OvRTQIbZGTXuW6WZWG1Wjr19tD15txVcx00HAP3odjL6nRKmi6pJtxbj6KU/fkPS8Q /7Pn1sVKrVDObX4NVFDlWVd8hC5tNi7kjmFOGeFC9jZQnFIhn27oOOdk++HMEV5GHyZb wW8/4p/Zfqd9nMDWRYyXfdQw37nO8VQJrT42hYgESAM0+/NKZoHTeS6ym5ejQ/9bo7jQ nnqBDmVzeBXx7H4IHKEzfACrg0vB/C6NQ0hKlb41Q9GhXDlwbZZLuQ3e7RChtYMNLOas gf8HsjkkBbS3xgl+jJrv+TpeGDQzxIjNjC0DJxOsZyE/iprIsuf41xjfx6lXKY+d5iCA fUmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768932148; x=1769536948; h=content-transfer-encoding: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=JnKPDRaAaWTl6tAgPx6C0e7LZiF9HhBKM2aTvFhAj90=; b=nxNMiiKa12+hSAagbM2O/7V/SRwvjhUgtgEkzeOgkCccbDOkQ4JnCw1i0S+v0HCmh4 2Re+LUuAzGbDiQqTRKvW1s/JWouCDjG6y3qHj1sF+7rYAn3ROYEbNA+SMUBBK0o/cF6Y 7XxVeuPP8ybW5RBdeqs6iDM4iU1+5rC3uSyC3gO6qwxOMNdIKAuCW65DPQrEy1Qm69px FoWUs6R4IpDIrhGkI4Mdq7OL2qC9Q1ep/8RBAuNC09ArRiRiWxW6knZXZhpaDwL9VG2k d7b0gaPv0iRfj9gJfM5C8P6fTgxk5y2jJVoMKv+63vdkhBgT1bN1zYyP/ORFWXTnubRm Q1eg== X-Forwarded-Encrypted: i=1; AJvYcCXklAucsLksC/fFLR70ts8ri0fasbfBWXxqXa6Ye9Qfo2rAVKlows2Dyl65URwLxBp9V3bW/Ilgs8gWXryL@lists.postgresql.org X-Gm-Message-State: AOJu0Yw3NbqvoyX2NQ93ZFiZrlPQuJ2Lh8qTDZ3iWOuZ3Z2mOt4CqAGh pY4inJW00Pn5UuilvRBfAhddJBW+CvepzVJi2sflu5aqSK+bMP8flA+rRMYHEYs/JbWOYvQlbLM nnS687cf7deox6VTYjkwlxzcnKRJLS/AjZkSN5J9J X-Gm-Gg: AZuq6aL9wKOlTX5vzghGHb2j6NmkMBuV+mNj4avjORCzTZx4lRXplZwlwQCInyGGrCQ LjU2+vfjn5VoUKgWZNBQVSP/SvMPUhCd2Gp2zrdFjqud3DEmiwurDqr49U0bIm7RAEBlCGfKexm VGcNfUrriov9X7dE1YWk1zKUXrZwkqlc+hMHxD2nd/D8M3hJbHOLZv5wEMSM/0S148gonDEyqqu 6hhI6fO2RJSyoujYlSHd/gP5hoM7Laf7gvTIlf5Bjzuw1CKNs4jBtp01bS4gqgz5XRwiIk24Q== X-Received: by 2002:a05:6102:3249:20b0:5f1:7aad:a8ef with SMTP id ada2fe7eead31-5f50a9d3cd6mr658946137.25.1768932147939; Tue, 20 Jan 2026 10:02:27 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Jacob Champion Date: Tue, 20 Jan 2026 10:02:16 -0800 X-Gm-Features: AZwV_QjUuztOri_XPmrPD1TgMGxWUGSipJVPaSKB2rUDtLpDEkBWhbP3nPucMw4 Message-ID: Subject: Re: Custom oauth validator options To: Zsolt Parragi Cc: VASUKI M , PostgreSQL Hackers , david.g.johnston@gmail.com, Robert Haas , myon@debian.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Jan 19, 2026 at 12:30=E2=80=AFPM Zsolt Parragi wrote: > This is again a bit of a different topic, but I could make that a > proper patch from this prototype. Let's separate the "verify session-preloaded GUCs" question from this feature request, yeah. > The important part for this thread is that if you would prefer a > version which completely verifies the pg_hba configuration before > accepting it, it's not that difficult to implement, or at least it's > not as complex as I originally imagined it. But even that won't > guarantee that the configuration always remains valid, because session > preload libraries can change without a server restart/reload... but > that's a rare corner case, and it could be a useful check most of the > time. Right. I've been thinking about strategy here, and I'm not sure I've solidified my thoughts yet, but I don't want to make you wait for that. So here goes: The inability to verify the HBA settings, without actively loading the extension, is a drawback whether we introduce a PGC_HBA or not. I feel pretty strongly that we can't require shared_preload_libraries for this use case. And given the choice between "you cannot modify per-HBA settings at all" and "we can't tell you until you test them whether they're valid or not", most people would probably prefer the latter limitation. Especially since the *values* for many existing HBA parameters cannot truly be "validated" without testing anyway; consider ldapserver etc. Since session_preload_libraries already can't do this, I don't feel too bad about us not doing it for a first version of the feature, but this limitation is likely to remain for a long time. Unless you think that there's a technical solution where the benefit easily outweighs the maintenance cost. And my guess is that this conversation is about to collide at high speed with the Postgres-threading work that's in progress. I like the idea of a PGC_HBA. I think it makes a lot of sense to be able set other GUC overrides here -- authentication_timeout, log_connections, pre/post_auth_delay. It seems architectually sound and generically useful. I'm worried that it's about to make a different decision from the decision that is being made for the pg_hosts.conf file for SNI. So this is not going to feel cohesive at first, and that's only "okay" if it becomes cohesive very quickly, which requires a larger audience. I'm also worried about namespace collisions between GUC and HBA. If we scope it to OAuth then that becomes easier (e.g. just prepend `validator.` or something to the setting name in HBA and then it's obvious what's going on). But if someone decides in PG20 that pam_use_hostname is a good GUC name for something, we're in trouble, because the existing HBA options do not plug into the GUC system. That's a lot of risk. High revert potential without multiple maintainers saying "yes", IMO, and if that happens we will have no improvement here for PG19. So, 1) how close to the sun do you feel like flying today? 2) do you agree with the above? 3) can your option (b) or (c) make enough use of existing GUC infrastructure, so that a future PGC_HBA could easily subsume an OAuth-specific solution, if people want to continue down that path in a less OAuth-centric thread? --Jacob