Re: postgres_fdw, dblink: Validate use_scram_passthrough values

From: Ayush Tiwari <ayushtiwari(dot)slg01(at)gmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: postgres_fdw, dblink: Validate use_scram_passthrough values
Date: 2026-05-27 16:00:07
Message-ID: CAJTYsWVs+AQ+ybn+xO9Vvt-WODF6pY4b0J+c2AUnsOZWzBhE3g@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Wed, 27 May 2026 at 20:12, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:

> Hi,
>
> The use_scram_passthrough option in postgres_fdw and dblink is
> intended to accept only boolean values. However, unlike other boolean
> options such as keep_connections, its value is not currently
> validated.
>
> As a result, invalid values are accepted unexpectedly, for example:
>
> CREATE SERVER test_server
> FOREIGN DATA WRAPPER postgres_fdw
> OPTIONS (use_scram_passthrough 'invalid');
>
> Attached patch updates postgres_fdw and dblink to validate
> use_scram_passthrough values and throw an error for invalid input.

Thanks for the patch, Fujii-san!

I applied it on HEAD and it looks good to me. The change looks consistent
with the existing validation of other boolean FDW options.

I also checked the behavior manually for both CREATE SERVER and CREATE USER
MAPPING in postgres_fdw and dblink. Invalid values are now rejected with:

ERROR: use_scram_passthrough requires a Boolean value

Regards,
Ayush

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2026-05-27 16:28:32 Re: [PATCH] Fix LISTEN startup race with direct advancement
Previous Message Heikki Linnakangas 2026-05-27 15:53:35 Re: Avoid orphaned objects dependencies, take 3