pgsql: createuser: Add support for more clause types through new option

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: createuser: Add support for more clause types through new option
Date: 2022-07-13 03:22:03
Message-ID: E1oBSws-002X52-4s@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

createuser: Add support for more clause types through new options

The following options are added to createuser:
* --valid-until to generate a VALID UNTIL clause for the role created.
* --bypassrls/--no-bypassrls for BYPASSRLS/NOBYPASSRLS.
* -m/--member to make the new role a member of an existing role, with an
extra ROLE clause generated. The clause generated overlaps with
-g/--role, but per discussion this was the most popular choice as option
name.
* -a/--admin for the addition of an ADMIN clause.

These option names are chosen to be completely new, so as they do not
impact anybody relying on the existing option set. Tests are added for
the new options and extended a bit, while on it, to cover more patterns
where quotes are added to various elements of the query generated.

Author: Shinya Kato
Reviewed-by: Nathan Bossart, Daniel Gustafsson, Robert Haas, Kyotaro
Horiguchi, David G. Johnston, Przemysław Sztoch
Discussion: https://postgr.es/m/69a9851035cf0f0477bcc5d742b031a3@oss.nttdata.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/08951a7c93cf0dd791ee6ac8a8cf5e4b152528e5

Modified Files
--------------
doc/src/sgml/ref/createuser.sgml | 56 +++++++++++++++++++++++++++++
src/bin/scripts/createuser.c | 72 +++++++++++++++++++++++++++++++++++--
src/bin/scripts/t/040_createuser.pl | 32 +++++++++++++++--
3 files changed, 156 insertions(+), 4 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message David Rowley 2022-07-13 05:01:25 pgsql: Small cleanup of create_list_bounds()
Previous Message David Rowley 2022-07-13 03:04:38 pgsql: Use list_copy_head() instead of list_truncate(list_copy(...), ..