postgres_fdw, dblink: Validate use_scram_passthrough values

Fujii Masao <masao.fujii@gmail.com>

From: Fujii Masao <masao.fujii@gmail.com>
To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2026-05-27T14:41:58Z
Lists: pgsql-hackers

Attachments

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.

Regards,

-- 
Fujii Masao