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