From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter <pmc@citylink.dinoex.sub.org>
Cc: pgsql-general@postgresql.org
Subject: Re: Locked out of schema public (pg_dump lacks backup of the grant)
Date: Wed, 06 Nov 2019 16:36:28 -0500
Message-ID: <24621.1573076188@sss.pgh.pa.us> (raw)
In-Reply-To: <20191106204925.GA17842@gate.oper.dinoex.org>
References: <20191106204925.GA17842@gate.oper.dinoex.org>
Peter <pmc@citylink.dinoex.sub.org> writes:
> If you do only "pg_restore -c -d <db>", the sessions can stay open,
> but then it will do
> DROP SCHEMA public;
> CREATE SCHEMA public;
> and it will NOT restore the grant because it is not in the backup.
We improved that situation in v11, I believe. What I see for this
case these days is per commit 5955d9341:
Also, change the very ad-hoc mechanism that was used to avoid dumping
creation and comment commands for the public schema. Instead of hardwiring
a test in _printTocEntry(), make use of the DUMP_COMPONENT_ infrastructure
to mark that schema up-front about what we want to do with it. This has
the visible effect that the public schema won't be mentioned in the output
at all, except for updating its ACL if it has a non-default ACL.
Previously, while it was normally not mentioned, --clean mode would drop
and recreate it, again causing headaches for non-superuser usage. This
change likewise makes the public schema less special and more like other
built-in objects.
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, pmc@citylink.dinoex.sub.org
Subject: Re: Locked out of schema public (pg_dump lacks backup of the grant)
In-Reply-To: <24621.1573076188@sss.pgh.pa.us>
References: <20191106204925.GA17842@gate.oper.dinoex.org> <24621.1573076188@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