Re: pg_upgrade test chatter

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Bossart, Nathan" <bossartn(at)amazon(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_upgrade test chatter
Date: 2021-10-19 19:36:14
Message-ID: 1950353.1634672174@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I wrote:
> "Bossart, Nathan" <bossartn(at)amazon(dot)com> writes:
>> I run 'make check-world' a lot, and I typically use parallelism and
>> redirect stdout to /dev/null as suggested in the docs [0]. This seems
>> to eliminate all of the test chatter except for this one message:
>> NOTICE: database "regression" does not exist, skipping

> Yeah, that's bugged me too ever since we got to the point where that
> was the only output ...

Actually ... why shouldn't we suppress that by running the command
with client_min_messages = warning? This would have to be a change
to pg_regress, but I'm having a hard time thinking of cases where
quieting that message would be a problem.

I tried doing this as a one-liner change in pg_regress's
drop_database_if_exists(), but the idea fell over pretty
quickly, because what underlies that is a "psql -c" call:

$ psql -c 'set client_min_messages = warning; drop database if exists foo'
ERROR: DROP DATABASE cannot run inside a transaction block

We could dodge that, with modern versions of psql, by issuing
two -c switches. So after a bit of hacking I have the attached
POC patch. It's incomplete because now that we have this
infrastructure we should change other parts of pg_regress
to not launch psql N times where one would do. But it's enough
to get through check-world without any chatter.

Any objections to polishing this up and pushing it?

regards, tom lane

Attachment Content-Type Size
multi-command-infrastructure-for-pg-regress.patch text/x-diff 4.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2021-10-19 19:53:54 Re: Inconsistent behavior of pg_dump/pg_restore on DEFAULT PRIVILEGES
Previous Message Andres Freund 2021-10-19 19:29:31 Re: pg_stat_bgwriter.buffers_backend is pretty meaningless (and more?)