Subject: pgsql: postgres_fdw, dblink: Validate use_scram_passthrough values

From: Fujii Masao <[email-masked]>
Date: Thu, 28 May 2026 11:59:31 +0000

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 <[email-masked]>
Reviewed-by: Ayush Tiwari <[email-masked]>
Reviewed-by: Matheus Alcantara <[email-masked]>
Discussion: https://postgr.es/m/[email-masked]
Backpatch-through: 18

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/8a86aa313a714adc56c74e4b08793e4e6102b5ca

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