Re: pgsql: Clean up role created in new subscription test. - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: pgsql: Clean up role created in new subscription test.
Date
Msg-id 202311081142.znnn3kgehvqo@alvherre.pgsql
Whole thread Raw
In response to Re: pgsql: Clean up role created in new subscription test.  (Peter Eisentraut <peter@eisentraut.org>)
Responses Re: pgsql: Clean up role created in new subscription test.
List pgsql-hackers
On 2023-Nov-08, Peter Eisentraut wrote:

> I think the earlier idea of just counting roles, tablespaces, etc. before
> and after would be sufficient.

Maybe record global objects in a permanent table in test_setup.sql

create table global_objs as
select 'role', rolname from pg_roles
union all
select 'tablespace', spcname from pg_tablespace;

and at the end (maybe in test tablespace, though it's unrelated but it's
what runs last and drops regress_tablespace), have

(select 'role', rolname from pg_roles
union all
select 'tablespace', spcname from pg_tablespace)
except
select * from global_objs;

and check the expected as empty.

-- 
Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/
"La verdad no siempre es bonita, pero el hambre de ella sí"



pgsql-hackers by date:

Previous
From: Dilip Kumar
Date:
Subject: Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock
Next
From: Tommy Pavlicek
Date:
Subject: Re: Commitfest: older Waiting on Author entries