Re: Add --{no-,}bypassrls flags to createuser

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Cc: Shinya Kato <Shinya11(dot)Kato(at)oss(dot)nttdata(dot)com>, Przemysław Sztoch <przemyslaw(at)sztoch(dot)pl>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, Daniel Gustafsson <daniel(at)yesql(dot)se>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Add --{no-,}bypassrls flags to createuser
Date: 2022-05-23 07:29:50
Message-ID: Yos37n9xGnax7uBg@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, May 20, 2022 at 02:45:19PM -0700, Nathan Bossart wrote:
> Thanks for the new patch! I attached a new version with a few small
> changes. What do you think?

So you have settled down to --member to emulate the clause ROLE.
Well, this choice is fine by me at the end.

> +$node->issues_sql_like(
> + [ 'createuser', 'regress_role2', '-a', 'regress_user1' ],
> + qr/statement: CREATE ROLE regress_role2 NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN ADMIN regress_user1;/,
> + 'add a role as a member with admin option of the newly created role');
> +$node->issues_sql_like(
> + [ 'createuser', 'regress_role3', '-m', 'regress_user1' ],
> + qr/statement: CREATE ROLE regress_role3 NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN ROLE regress_user1;/,
> + 'add a role as a member of the newly created role');

May I ask for the addition of tests when one specifies multiple
switches for --admin and --member? This would check the code path
where you build a list of role names. You could check fancier string
patterns, while on it, to look after the use of fmtId(), say with
role names that include whitespaces or such.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2022-05-23 08:13:40 Re: psql now shows zero elapsed time after an error
Previous Message Michael Paquier 2022-05-23 06:53:06 Re: Allow file inclusion in pg_hba and pg_ident files