From: | Tomas Vondra <tomas(dot)vondra(at)postgresql(dot)org> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: createdb: compare strategy case-insensitive |
Date: | 2024-04-21 19:31:41 |
Message-ID: | E1rycub-003DFy-4d@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
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
------
REL_16_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/9e6faeb3249d420a22ad8a5fbcf093b272c02cb8
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(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Tomas Vondra | 2024-04-21 19:31:53 | pgsql: createdb: compare strategy case-insensitive |
Previous Message | Tomas Vondra | 2024-04-21 19:31:24 | pgsql: createdb: compare strategy case-insensitive |