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 1wOsur-000G94-1G for pgsql-hackers@arkaria.postgresql.org; Mon, 18 May 2026 08:01:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wOsup-001UGA-1G for pgsql-hackers@arkaria.postgresql.org; Mon, 18 May 2026 08:01:32 +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 1wOsup-001UG1-0L for pgsql-hackers@lists.postgresql.org; Mon, 18 May 2026 08:01:32 +0000 Received: from mail-oo1-xc35.google.com ([2607:f8b0:4864:20::c35]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wOsuo-000000009Xz-0FGi for pgsql-hackers@lists.postgresql.org; Mon, 18 May 2026 08:01:31 +0000 Received: by mail-oo1-xc35.google.com with SMTP id 006d021491bc7-67e09232daeso1063176eaf.2 for ; Mon, 18 May 2026 01:01:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1779091288; cv=none; d=google.com; s=arc-20240605; b=OVoGZcdiysxQSAB0Oaw7MyRcbSaHrdvotJHNRuD0lrnnRTsIA6KHJXPifoy3QiOruv zC5FitkM2hBjUvJzmMAJEMc5RRTpYNJy9SIa3AO3KeOBUjbU+6qz0VLl+X1uq61k3dap VYq7vJqU59paEH8iKgpnHt3nSOU+2pBdoQU5KD/WLxX+4aDtWOfH1tydxxijKq3Ypgro 779J1NhVFIglNUpmYKkKatN60/6A71OfFJU0kcBLdzTlaLLMNlgGAUVJ4tMgmzVVkP2h tG/GH4gvSO6zAOkNznf5kgHX/hDXLb/L/GN0vASn4OdlBRsVTZlxdhcJ0dLYcZjfSt4z QZVg== 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=9Qm9nYOEnefaVpkCgmaiGAsBlRXp3m0aKmNm307XmHs=; fh=msZ7vH1mbfja6+/WmutU4aZKNzdKO1jR7OxAI2TbZtI=; b=AeNBNlW526PZkwQAvpoA92MoNIy/fu+J1WXM7092IHIcZiufpY4nviS4XMdPVRwiF4 wJCPuU8o6XZpzanJw/U/h2U6TSsela+FCyhj2PJ0Ssp2RXemMHx/F2vP7/3kAhikG+Db L9g7jL5wPoI7x9yEdwJcaStWI2KFLhge9uQ4fCVoULhNqO1IYqiALAEszL6qy53yNTej oe3L1ebrH1Pxx7iklDO+528K/qfhqXYONjxAPbqEEkwyN/yLehdrJcyOWl3VrB0g1vYQ KnD1erFt5eCKZMuPzNjU/QAxoxR2J3/XYGg+9/wuJ126rM5VAybuHLiGa1IEh7bhrtJ1 D5+A==; 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=gmail.com; s=20251104; t=1779091288; x=1779696088; 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=9Qm9nYOEnefaVpkCgmaiGAsBlRXp3m0aKmNm307XmHs=; b=F8gW9W39jYRQNEYHNw6Lc6YSlsqNXJIX3DGl3ewbKauM7rdQwuChDzLxszO7+Ve69W FzP8Oqej0moCvrjtLepvJXf+pzHB1DkjPHgdlM6k1eNNETbEKDCRkq6ZaEGcNptq6JW4 UlAXHtCgVqLWhHIury7FA3hBa8ZzXOlfrvD5vvmlxt3ok12gIj8O2vcL297fj50qrNdp z19ue26zlsIP3wKdNoBYsDFFSBkPkdbu0Lulyb+QycL9/RumjJG7DwZM9FSbJ7RgfbZz qGcUD9rjgDNF5FtZFhqygDbHpa92N5vFqa1jl8AvndXJrVZRHgmsh5drWvd2wJ99Xaq8 NDDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779091288; x=1779696088; 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=9Qm9nYOEnefaVpkCgmaiGAsBlRXp3m0aKmNm307XmHs=; b=RiNPdtyJfHvSQY/U3gOyKUo/nXQ852hV8qJFyuEy2VVn7aFaNiizmZzEoVGns+zrqo PuloLwSDh+vidw6POCUCvqgzS4E1Ka6SoWfVVewwtxbTOymE4MRyMRfVfEuR4YB1BB33 J9gEubVbg9DX2dsMTJmrO1UetnV2OQTUqcq9hnAT2GX9Q2FOe49AAzxnZkeflg3jF1p1 ZijzhDiCSQYDAZ7ERRCfvLh8RNwlxQu3MkIqCsSJmMy0uLy+bapmKUwPf4LaQr0ZT5yE dad2l/rh/xMifNdAXr7zJb0JLc7Ceg2+vAmgNjbAGycUraCEa8LrOdTJ9wHH1JLdeVoU NKHg== X-Gm-Message-State: AOJu0YzAUTyE8QXDAhsQj0H0ecR89daXcHgfLrGr05UewzN2HI8pwsl0 EwSgnCVLiwRf8iYy9Pehe2Xh79pKAkRSW8pRs3tuglXcqusWyUSkYVaG9Qu9oao7jOwSlmKcJ9C hRKU7fuDoBecZZf/nsxW+VaYfq3IU/J8= X-Gm-Gg: Acq92OFZyXil2voez+lkaaqgaHTrcmVCWS1nMXL2X8F25+uGf52w24MT8Eoo+DtbEoj zNk/gdFIyqd8Gb84Hx6JUTstFNvS8q0m8WT3WggRJztbOcli4+bxtsWN9mbIWP+1tmc+EUCGYLV laiujZAbMV0qMNYwZfeJtjYOMgqDonOFhRtAsFVRudC85yGJ9YBXvV0ZASss9TdBtRNnF5ufbsc Uw7osYCFbbJNHWE9xcJka9ASSncpfOFAQt2o9QMjG4s5cF87hVjFSwmvO2Ffi2j8wIsJgUTs1au Nj2KGuraWQkUNAic9xuXbChkelweaDVL6Ckb77RcnEGbOKbWoMg+ X-Received: by 2002:a05:6820:1621:b0:696:573c:9f0b with SMTP id 006d021491bc7-69c942d9b92mr9167440eaf.14.1779091287928; Mon, 18 May 2026 01:01:27 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Fujii Masao Date: Mon, 18 May 2026 17:01:14 +0900 X-Gm-Features: AVHnY4JZcOecfcTqYhlrDJLXTgsioNw8Z7t_-Q1OmWN64iLV7fH949Hj3cKFbXI Message-ID: Subject: Re: postgres_fdw: use_scram_passthrough on user mapping is ignored when also set on server To: Matheus Alcantara Cc: PostgreSQL Hackers 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 Sat, May 16, 2026 at 12:46=E2=80=AFAM Matheus Alcantara wrote: > > /* > > * Return whether SCRAM pass-through is enabled. > > * > > * If use_scram_passthrough is specified in both the foreign server > > * and the user mapping, the user mapping setting takes precedence. > > */ > > > > Sounds good, fixed. Thanks! > Yeah, good catch, this is from 3642df265d0. The problem is that > dblink_fdw_validator() was changed to call is_valid_dblink_fdw_option() > instead of is_valid_dblink_option() to make CRETE SERVER ... OPTIONS > (use_scram_passthrough '...'); works but I miss the fact that it's also > used by ALTER FOREIGN DATA WRAPPER. The new attached 0003 fix this by > only checking the fdw options when the validator context is from foreign > server or user mapping. Thanks for the patches! Neither dblink nor postgres_fdw seems to have tests checking whether option= s are specified at the proper object level (foreign server, user mapping, etc= .). So adding the test for ALTER FOREIGN DATA WRAPPER ... (use_scram_passthrough ...) seems a bit overkill to me. Also, even if we decide to add such a test, it might be simpler to put it in sql/dblink.sql rather than as a TAP test. Thoughts? > Are you considering backporting these patches? I think that 0003 is > good, not sure about 0001 and 0002. I assume your concern is that v18 was already released with the current behavior, where the server-level use_scram_passthrough setting overrides the user-mapping-level one. Backpatching the behavior change to v18 could therefore affect existing users relying on that behavior, right? If the documentation had clearly stated that the user-mapping-level setting takes precedence, we could reasonably treat the current behavior as a bug and change it even in v18. But since there is no such documentation, I understand the hesitation. That said, I'm feeling tempted to backpatch the change to v18, because havi= ng only v18 behave differently seems odd and potentially confusing... The issue addressed by patch 0003 may have a similar concern. However, since use_scram_passthrough set on dblink_fdw currently has no effect even if there are existing users depending on that, it seems acceptable to change that behavior in v18. Is that your thinking? Regards, --=20 Fujii Masao