From: | Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | "Bossart, Nathan" <bossartn(at)amazon(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: pg_upgrade test chatter |
Date: | 2021-10-20 01:55:31 |
Message-ID: | 202110200155.jeev2mn6o6sy@alvherre.pgsql |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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/
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2021-10-20 02:04:51 | Re: [RFC] building postgres with meson |
Previous Message | Andres Freund | 2021-10-20 01:49:43 | Re: [RFC] building postgres with meson |