pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Specify the encoding of input to fmtId()
Date: Mon, 10 Feb 2025 15:09:49 +0000
Message-ID: <E1thVPw-006NyP-T0@gemulon.postgresql.org> (raw)

Specify the encoding of input to fmtId()

This commit adds fmtIdEnc() and fmtQualifiedIdEnc(), which allow to specify
the encoding as an explicit argument.  Additionally setFmtEncoding() is
provided, which defines the encoding when no explicit encoding is provided, to
avoid breaking all code using fmtId().

All users of fmtId()/fmtQualifiedId() are either converted to the explicit
version or a call to setFmtEncoding() has been added.

This commit does not yet utilize the now well-defined encoding, that will
happen in a subsequent commit.

Reviewed-by: Noah Misch <noah@leadboat.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Backpatch-through: 13
Security: CVE-2025-1094

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/2ae54ae17eaad592991e7459140b2cad2e82745c

Modified Files
--------------
src/bin/pg_dump/pg_backup_archiver.c |  1 +
src/bin/pg_dump/pg_dump.c            |  1 +
src/bin/pg_dump/pg_dumpall.c         |  1 +
src/bin/psql/command.c               |  3 ++
src/bin/scripts/common.c             |  5 ++-
src/bin/scripts/createdb.c           |  2 +
src/bin/scripts/createuser.c         |  2 +
src/bin/scripts/dropdb.c             | 13 +++---
src/bin/scripts/dropuser.c           |  3 +-
src/bin/scripts/reindexdb.c          | 11 +++--
src/bin/scripts/vacuumdb.c           |  5 ++-
src/fe_utils/string_utils.c          | 84 +++++++++++++++++++++++++++++++++---
src/include/fe_utils/string_utils.h  |  3 ++
13 files changed, 112 insertions(+), 22 deletions(-)



view thread (6+ messages)  latest in thread

Message-ID: <E1thVPw-006NyP-T0@gemulon.postgresql.org>
Permalink:  ../E1thVPw-006NyP-T0@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1thVPw-006NyP-T0@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: andres@anarazel.de, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Specify the encoding of input to fmtId()
  In-Reply-To: <E1thVPw-006NyP-T0@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