pgsql: Disallow "=" in names of reloptions and foreign-data options.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Disallow "=" in names of reloptions and foreign-data options.
Date: 2025-06-02 19:23:03
Message-ID: [email protected]
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Disallow "=" in names of reloptions and foreign-data options.

We store values for these options as array elements with the syntax
"name=value", hence a name containing "=" confuses matters when
it's time to read the array back in. Since validation of the
options is often done (long) after this conversion to array format,
that leads to confusing and off-point error messages. We can
improve matters by rejecting names containing "=" up-front.

(Probably a better design would have involved pairs of array
elements, but it's too late now --- and anyway, there's no
evident use-case for option names like this. We already
reject such names in some other contexts such as GUCs.)

Reported-by: Chapman Flack <jcflack(at)acm(dot)org>
Author: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Reviewed-by: Chapman Flack <jcflack(at)acm(dot)org>
Discussion: https://postgr.es/m/[email protected]
Backpatch-through: 13

Branch
------
REL_16_STABLE

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

Modified Files
--------------
contrib/file_fdw/expected/file_fdw.out | 4 ++++
contrib/file_fdw/sql/file_fdw.sql | 2 ++
src/backend/access/common/reloptions.c | 17 +++++++++++++----
src/backend/commands/foreigncmds.c | 15 +++++++++++++--
4 files changed, 32 insertions(+), 6 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Fujii Masao 2025-06-03 01:04:15 pgsql: Rename log_lock_failure GUC to log_lock_failures for consistency
Previous Message Melanie Plageman 2025-06-02 14:55:36 pgsql: Correct heap vacuum boundary state setup ordering