From: Peter <pmc@citylink.dinoex.sub.org>
To: pgsql-general@postgresql.org
Subject: Re: Locked out of schema public (pg_dump lacks backup of the grant)
Date: Wed, 6 Nov 2019 21:49:25 +0100
Message-ID: <20191106204925.GA17842@gate.oper.dinoex.org> (raw)
Long story short:
pg_dump just forgets to backup the grant on schema public. :(
Long story:
After searching for half an hour to get some comprehensive listing
of permissions (which was in vain) I tried with pgadmin3 (which is
indeed a life-saver and still somehow works on 10.10 - and that's
the reason I am reluctant to upgrade postgres, as this can only get
worse) - and then it was a simple action of comparing page-by-page:
GRANT ALL ON SCHEMA public TO public;
That one is missing on the restored database.
So, if you do a "pg_restore -C -c -d postgres", then you get that
grant from the template database, and no problem. (But this is ugly,
as you need to find and terminate all the connections on the db.)
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.
I'd like to call this a bug.
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: pmc@citylink.dinoex.sub.org
Subject: Re: Locked out of schema public (pg_dump lacks backup of the grant)
In-Reply-To: <20191106204925.GA17842@gate.oper.dinoex.org>
References: <20191106204925.GA17842@gate.oper.dinoex.org>
* 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