Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1phyu4-0002cg-Uj for pgsql-hackers@arkaria.postgresql.org; Thu, 30 Mar 2023 20:29:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1phyu2-00061M-66 for pgsql-hackers@arkaria.postgresql.org; Thu, 30 Mar 2023 20:29:46 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1phyu1-00061C-T5 for pgsql-hackers@lists.postgresql.org; Thu, 30 Mar 2023 20:29:45 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1phytu-0006n5-Sd for pgsql-hackers@postgresql.org; Thu, 30 Mar 2023 20:29:44 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 32UKTaYk284966; Thu, 30 Mar 2023 16:29:36 -0400 From: Tom Lane To: Daniel Gustafsson cc: Robert Haas , PostgreSQL Hackers Subject: Re: pgsql: Clean up role created in new subscription test. In-reply-to: <99112997-6732-42C7-989B-06406C911FE2@yesql.se> References: <267900.1680201870@sss.pgh.pa.us> <99112997-6732-42C7-989B-06406C911FE2@yesql.se> Comments: In-reply-to Daniel Gustafsson message dated "Thu, 30 Mar 2023 21:19:17 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <284964.1680208176.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 30 Mar 2023 16:29:36 -0400 Message-ID: <284965.1680208176@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Daniel Gustafsson writes: >> On 30 Mar 2023, at 20:44, Tom Lane wrote: >> Maybe it'd be close enough to expect there to be no roles named >> "regress_xxx". In combination with >> -DENFORCE_REGRESSION_TEST_NAME_RESTRICTIONS, that would prevent us >> from accidentally leaving stuff behind, and we could hope that it doesn= 't >> cause false failures in real installations. > Would that check be always on or only when pg_regress is compiled with > -DENFORCE_REGRESSION_TEST_NAME_RESTRICTIONS? I envisioned it as being on all the time. >> Another idea could be for pg_regress to enforce that "select count(*) >> from pg_roles" gives the same answer before and after the test run. > That wouldn't prevent the contents of pg_roles to have changed though, s= o there > is a (slim) false positive risk with that no? Well, we could do "select rolname from pg_roles order by 1" and actually compare the results of the two selects. That might be advisable anyway, in order to produce a complaint with useful detail when there is something wrong. regards, tom lane