pgsql: postgres_fdw, dblink: Validate use_scram_passthrough values

From: Fujii Masao <fujii(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: postgres_fdw, dblink: Validate use_scram_passthrough values
Date: 2026-05-28 11:59:49
Message-ID: E1wSZOv-001Uee-0X@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

postgres_fdw, dblink: Validate use_scram_passthrough values

The use_scram_passthrough option in postgres_fdw and dblink accepts
only boolean values. However, unlike other boolean options such as
keep_connections, its value was not previously validated.

As a result, commands such as
"CREATE SERVER ... OPTIONS (use_scram_passthrough 'invalid')"
could succeed unexpectedly.

This commit updates postgres_fdw and dblink to validate that
use_scram_passthrough is assigned a valid boolean value, and throw an
error for invalid input.

Backpatch to v18, where use_scram_passthrough was introduced.

Author: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Reviewed-by: Ayush Tiwari <ayushtiwari(dot)slg01(at)gmail(dot)com>
Reviewed-by: Matheus Alcantara <matheusssilv97(at)gmail(dot)com>
Discussion: https://postgr.es/m/CAHGQGwF+-k-Ehsu5W94ZP7GxS3wiBd+mi0PfGTdJ_i2Yr0zR3g@mail.gmail.com
Backpatch-through: 18

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/e5d019fbdc12281f666a94d3d2cf8ad33ae2006a

Modified Files
--------------
contrib/dblink/dblink.c | 3 +++
contrib/postgres_fdw/option.c | 3 ++-
2 files changed, 5 insertions(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Fujii Masao 2026-05-28 12:54:43 pgsql: postgres_fdw: Fix whitespace violation in connection.c
Previous Message Fujii Masao 2026-05-28 11:59:31 pgsql: postgres_fdw, dblink: Validate use_scram_passthrough values