createuser: Add support for more clause types through new options
authorMichael Paquier
Wed, 13 Jul 2022 03:21:20 +0000 (12:21 +0900)
committerMichael Paquier
Wed, 13 Jul 2022 03:21:20 +0000 (12:21 +0900)
commit08951a7c93cf0dd791ee6ac8a8cf5e4b152528e5
tree8df0cc6cc141afde94f98d3ac9ac32421e428d76
parentc23e3e6beb273ae8c0f8e616edb7ed1acb0271c4
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
doc/src/sgml/ref/createuser.sgml
src/bin/scripts/createuser.c
src/bin/scripts/t/040_createuser.pl