pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Peter Eisentraut <peter@eisentraut.org>
Cc: Daniel Gustafsson <daniel@yesql.se>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Subject: Re: pgsql: Clean up role created in new subscription test.
Date: Wed, 8 Nov 2023 12:42:26 +0100
Message-ID: <202311081142.znnn3kgehvqo@alvherre.pgsql> (raw)
In-Reply-To: <41dba437-5622-4ae0-a6bb-726da8771584@eisentraut.org>

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í"





view thread (28+ messages)  latest in thread

Message-ID: <202311081142.znnn3kgehvqo@alvherre.pgsql>
Permalink:  ../202311081142.znnn3kgehvqo@alvherre.pgsql/
Also on:    postgresql.org/message-id/202311081142.znnn3kgehvqo@alvherre.pgsql

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: alvherre@alvh.no-ip.org, peter@eisentraut.org, daniel@yesql.se, tgl@sss.pgh.pa.us, robertmhaas@gmail.com, pgsql-hackers@postgresql.org
  Subject: Re: pgsql: Clean up role created in new subscription test.
  In-Reply-To: <202311081142.znnn3kgehvqo@alvherre.pgsql>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox