pgsql: Fix handling of default option values in createuser

From: Daniel Gustafsson <dgustafsson(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix handling of default option values in createuser
Date: 2023-03-06 13:19:53
Message-ID: E1pZAkq-002BxW-Rd@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix handling of default option values in createuser

Add description of which one is the default between two complementary
options of --bypassrls and --replication in the help text and docs. In
correspondence let the command always include the tokens corresponding
to every options of that kind in the SQL command sent to server. Tests
are updated accordingly.

Also fix the checks of some trivalue vars which were using literal zero
for checking default value instead of the enum label TRI_DEFAULT. While
not a bug, since TRI_DEFAULT is defined as zero, fixing improves read-
ability improved readability (and avoid bugs if the enum is changed).

Author: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
Discussion: https://postgr.es/m/20220810.151243.1073197628358749087.horikyota.ntt@gmail.com

Branch
------
master

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

Modified Files
--------------
doc/src/sgml/ref/createuser.sgml | 2 +-
src/bin/scripts/createuser.c | 21 ++++++++++++++-------
src/bin/scripts/t/040_createuser.pl | 18 +++++++++---------
3 files changed, 24 insertions(+), 17 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2023-03-06 15:26:22 pgsql: In basebackup.c, perform end-of-file test after checksum validat
Previous Message Michael Paquier 2023-03-06 07:42:11 pgsql: Add PROCESS_MAIN to VACUUM