Re: pg_upgrade test chatter - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: pg_upgrade test chatter
Date
Msg-id 202110200155.jeev2mn6o6sy@alvherre.pgsql
Whole thread Raw
In response to Re: pg_upgrade test chatter  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: pg_upgrade test chatter  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 2021-Oct-19, Tom Lane wrote:

> 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.

Isn't it easier to pass client_min_messages via PGOPTIONS?

PGOPTIONS="-c client_min_messages=warning" psql -c "drop database if exists foo"


-- 
Álvaro Herrera           39°49'30"S 73°17'W  —  https://www.EnterpriseDB.com/



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: [RFC] building postgres with meson
Next
From: Tom Lane
Date:
Subject: Re: [RFC] building postgres with meson