Re: postgres_fdw: use_scram_passthrough on user mapping is ignored when also set on server

From: "Matheus Alcantara" <matheusssilv97(at)gmail(dot)com>
To: "Fujii Masao" <masao(dot)fujii(at)gmail(dot)com>, "PostgreSQL Hackers" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: postgres_fdw: use_scram_passthrough on user mapping is ignored when also set on server
Date: 2026-05-14 20:18:58
Message-ID: DIIOEOI2RTVC.1J8PO0GO2VZIG@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Thu May 14, 2026 at 2:57 PM -03, Fujii Masao wrote:
> use_scram_passthrough can be specified both on a foreign server and
> on a user mapping. I found that when both are specified, currently
> the server-level setting overrides the user mapping setting. Is this
> precedence intentional?
>
> That seems inconsistent with the usual expectation that foreign server
> options act as shared defaults, while user mapping options provide
> per-user overrides. If the same option is specified in both places,
> I would expect the user mapping setting to take precedence. Thoughts?
>
> If the current behavior is intentional, I'd like to document the precedence
> when use_scram_passthrough is specified in both a foreign server and
> a user mapping. Otherwise, I'd like to change postgres_fdw to prefer
> the user mapping setting and update the documentation accordingly.
>

I agree that that user mapping setting should take precedence. The
current behavior seems not correct since we are not able to
enable/disable the scram passthrough to a specific user mapping.

dblink also implement the same behavior, so I think that it should also
be changed as postgres_fdw.

The attached patches implement this change for postgres_fdw and dblink.

--
Matheus Alcantara
EDB: https://www.enterprisedb.com

Attachment Content-Type Size
v1-0001-postgres_fdw-Allow-user-mapping-to-override-use_s.patch text/plain 4.9 KB
v1-0002-dblink-Allow-user-mapping-to-override-use_scram_p.patch text/plain 5.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2026-05-14 21:14:12 Re: [PATCH] refint: Avoid reusing cascade UPDATE plans.
Previous Message Robert Haas 2026-05-14 19:51:19 Re: call for applications: hacker mentoring 2026