From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter_e@gmx.net>
Cc: Andrew Dunstan <andrew@dunslane.net>
Cc: pgsql-hackers@postgreSQL.org
Subject: Re: [COMMITTERS] pgsql: Fix pg_dump to dump shell types.
Date: Mon, 10 Aug 2015 16:40:31 -0400
Message-ID: <8191.1439239231@sss.pgh.pa.us> (raw)
In-Reply-To: <55C902E8.2010400@gmx.net>
References: <E1ZMljD-0006bX-Fi@gemulon.postgresql.org>
<55C7CF3B.30703@dunslane.net>
<20081.1439158993@sss.pgh.pa.us>
<55C902E8.2010400@gmx.net>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
Peter Eisentraut <peter_e@gmx.net> writes:
> On 8/9/15 6:23 PM, Tom Lane wrote:
>> It looks to me like the reason for this is that pg_dump forces the
>> "typacl" of a type to be '{=U}' when reading the schema data for a
>> pre-9.2 type, rather than reading it as NULL (ie default permissions)
>> which would result in not printing any grant/revoke commands for
>> the object.
>>
>> I do not see a good reason for that; quite aside from this problem,
>> it means there is one more place that knows the default permissions
>> for a type than there needs to be. Peter, what was the rationale?
> This was probably just copied from how proacl and lanacl are handled,
> which predate typacl by quite a bit. Maybe there was a reason in those
> days.
Hm ... I wonder whether those are well-thought-out either.
> It might also have something to do with how owner privileges are
> handled. An explicit '{=U}' doesn't create owner privileges, unlike a
> null value in that field. Maybe this is necessary if you dump and
> restore between databases with different user names.
But now that you mention it, isn't that completely broken? What pg_dump
actually prints given this made-up data is
REVOKE ALL ON TYPE myshell FROM PUBLIC;
REVOKE ALL ON TYPE myshell FROM postgres;
GRANT ALL ON TYPE myshell TO PUBLIC;
which seems like a completely insane interpretation. There is no way
that dumping a type from a pre-typacl database and restoring it into
a newer one should end up with the type's owner having no privileges
on it. I'm astonished that we've not gotten bug reports about that.
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
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-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us, peter_e@gmx.net, andrew@dunslane.net, pgsql-hackers@postgreSQL.org
Subject: Re: [COMMITTERS] pgsql: Fix pg_dump to dump shell types.
In-Reply-To: <8191.1439239231@sss.pgh.pa.us>
References: <E1ZMljD-0006bX-Fi@gemulon.postgresql.org> <55C7CF3B.30703@dunslane.net> <20081.1439158993@sss.pgh.pa.us> <55C902E8.2010400@gmx.net> <8191.1439239231@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