pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Disallow "=" in names of reloptions and foreign-data options.
Date: Mon, 02 Jun 2025 19:23:03 +0000
Message-ID: <E1uMAkQ-00040e-2U@gemulon.postgresql.org> (raw)

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@acm.org>
Author: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Chapman Flack <jcflack@acm.org>
Discussion: https://postgr.es/m/6830EB30.8090904@acm.org
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(-)



view thread (6+ messages)  latest in thread

Message-ID: <E1uMAkQ-00040e-2U@gemulon.postgresql.org>
Permalink:  ../E1uMAkQ-00040e-2U@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1uMAkQ-00040e-2U@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Disallow "=" in names of reloptions and foreign-data options.
  In-Reply-To: <E1uMAkQ-00040e-2U@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox