Re: pgsql: Clean up role created in new subscription test.

Daniel Gustafsson <daniel@yesql.se>

From: Daniel Gustafsson <daniel@yesql.se>
To: Peter Eisentraut <peter@eisentraut.org>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Robert Haas <robertmhaas@gmail.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2023-11-08T12:15:00Z
Lists: pgsql-hackers
> On 8 Nov 2023, at 08:55, Peter Eisentraut <peter@eisentraut.org> wrote:
> 
> On 06.07.23 00:00, Daniel Gustafsson wrote:
>>> On 16 May 2023, at 11:17, Daniel Gustafsson <daniel@yesql.se> wrote:
>>> Parked in the July CF for now.
>> Rebased to fix a trivial conflict highlighted by the CFBot.
> 
> I think the problem with this approach is that one would need to reapply it to each regression test suite separately.  For example, there are several tests under contrib/ that create roles.  These would not be covered by this automatically.
> 
> I think the earlier idea of just counting roles, tablespaces, etc. before and after would be sufficient.

It's been a while but if memory serves me right, one of the reasons for this
approach was that pg_regress didn't use libpq so running queries and storing
results for comparisons other than diffing .out files was painful at best.

Since 66d6086cbc pg_regress does have a dependency on libpq so we can now
perform that bookkeeping a bit easier.  I still find it more elegant to at
least compare the contents and not just the count, but I can take a stab at a
revised patch since this approach doesn't seem to appeal to the thread.

--
Daniel Gustafsson




Commits

  1. Drop global objects after completed test

  2. Fix reported runtime for single tests in pg_regress

  3. Clean up role created in new subscription test.