From: Tom Lane <tgl@sss.pgh.pa.us>
To: Karsten Hilbert <Karsten.Hilbert@gmx.net>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: pg_dump/pg_restore vs default_transaction_read_only under PG 13.2
Date: Sun, 20 Jun 2021 13:47:47 -0400
Message-ID: <1511776.1624211267@sss.pgh.pa.us> (raw)
In-Reply-To: <YM9xKBUhojhlOLuP@hermes.hilbert.loc>
References: <YM9xKBUhojhlOLuP@hermes.hilbert.loc>
Karsten Hilbert <Karsten.Hilbert@gmx.net> writes:
> I am testing the pg_restore of a database with
> default_transaction_read_only=on.
Hm. It's intentional that we reconnect after applying the database
properties, so that they are in effect during the restore. It seems
likely that failing to do so could result in misbehaviors.
Hence, the only way to make this scenario work would be for the
restore script to explicitly override default_transaction_read_only.
That seems like a darn bad idea, really. If pg_dump thinks it's
authorized to ignore that, why shouldn't every other application?
Also, doing so would result in ignoring default_transaction_read_only
no matter what the source of that was. I think it's probably not
hard to construct scenarios where someone would really not be happy
about such behavior.
In short, I'm inclined to say "don't do that". Maybe it'd be
a better idea to apply default_transaction_read_only to particular
roles (and not run pg_restore under such a role).
regards, tom lane
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, Karsten.Hilbert@gmx.net
Subject: Re: pg_dump/pg_restore vs default_transaction_read_only under PG 13.2
In-Reply-To: <1511776.1624211267@sss.pgh.pa.us>
References: <YM9xKBUhojhlOLuP@hermes.hilbert.loc> <1511776.1624211267@sss.pgh.pa.us>
* 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