pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tomas.vondra@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: createdb: compare strategy case-insensitive
Date: Sun, 21 Apr 2024 19:31:24 +0000
Message-ID: <E1rycuJ-003DFM-Ly@gemulon.postgresql.org> (raw)

createdb: compare strategy case-insensitive

When specifying the createdb strategy, the documentation suggests valid
options are FILE_COPY and WAL_LOG, but the code does case-sensitive
comparison and accepts only "file_copy" and "wal_log" as valid.

Fixed by doing a case-insensitive comparison using pg_strcasecmp(), same
as for other string parameters nearby.

While at it, apply fmtId() to a nearby "locale_provider". This already
did the comparison in case-insensitive way, but the value would not be
double-quoted, confusing the parser and the error message.

Backpatch to 15, where the strategy was introduced.

Backpatch-through: 15
Reviewed-by: Tom Lane
Discussion: https://postgr.es/m/90c6913a-1dd2-42b4-8365-ce3b09c39b17@enterprisedb.com

Branch
------
master

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

Modified Files
--------------
src/backend/commands/dbcommands.c |  6 +++---
src/bin/scripts/createdb.c        |  2 +-
src/bin/scripts/t/020_createdb.pl | 10 ++++++++++
3 files changed, 14 insertions(+), 4 deletions(-)



view thread (4+ messages)  latest in thread

Message-ID: <E1rycuJ-003DFM-Ly@gemulon.postgresql.org>
Permalink:  ../E1rycuJ-003DFM-Ly@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1rycuJ-003DFM-Ly@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: tomas.vondra@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: createdb: compare strategy case-insensitive
  In-Reply-To: <E1rycuJ-003DFM-Ly@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