Re: pgsql: Adjust interaction of CREATEROLE with role properties.

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Justin Pryzby <pryzby(at)telsasoft(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Robert Haas <robertmhaas(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Adjust interaction of CREATEROLE with role properties.
Date: 2023-01-28 02:27:52
Message-ID: Y9SIKM43sxo5Npp9@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

On Fri, Jan 27, 2023 at 10:46:53AM -0500, Tom Lane wrote:
> I was imagining that pg_regress could contain a function that
> issues some predefined queries and complains if the results
> aren't empty. It already has the ability to issue commands
> to the cluster-under-test (for the initial CREATE DATABASE etc)
> so at least most of the infrastructure is easily at hand.

Agreed. I was also thinking among these lines this morning after
waking up. There is a pattern here, actually. Without storing full
queries, we could have a function that has arguments about:
- The attribute name to report back if we find an unwanted name.
- The catalog name to query.
- The qual to use.

That's an implementation detail, though.

There is also a gotcha that has not been mentioned yet: there should
be an option switch to control if this check is run or not. In the
tree, test_pg_dump is an exception where this is not going to work,
because we leave around the role regress_dump_test_role after repeated
installchecks. It has been argued in the past that this should be
cleaned up, but also counter-argued that this is useful for pg_upgrade
in the buildfarm with the dump of extensions.
--
Michael

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Amit Kapila 2023-01-30 02:46:10 pgsql: Rename GUC logical_decoding_mode to logical_replication_mode.
Previous Message Thomas Munro 2023-01-28 02:09:32 pgsql: Remove unneeded volatile qualifiers from postmaster.c.