From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bruce Momjian <bruce@momjian.us>
Cc: m.sakrejda@gmail.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #6706: pg_upgrade fails when plpgsql dropped/re-created
Date: Sat, 30 Jun 2012 14:37:47 -0400
Message-ID: <14513.1341081467@sss.pgh.pa.us> (raw)
In-Reply-To: <20120630162858.GC20759@momjian.us>
References: <E1SjIEG-0007Xu-PW@wrigleys.postgresql.org>
<20120630015430.GA912@momjian.us>
<336.1341027315@sss.pgh.pa.us>
<20120630050007.GA20759@momjian.us>
<11221.1341069176@sss.pgh.pa.us>
<20120630162858.GC20759@momjian.us>
Bruce Momjian <bruce@momjian.us> writes:
> On Sat, Jun 30, 2012 at 11:12:56AM -0400, Tom Lane wrote:
>> Did it restore the nonstandard ownership of the schema?
> No --- drop/create of the public schema produces:
> ...
> However, surprisingly, a simple pg_dump/restore also does not preserve
> the public schema permissions either. :-(
Right. My point is that there is a whole lot of stuff that initdb
creates but does not mark "pinned" in pg_depend, with the intention that
users could drop it, and perhaps recreate similarly-named objects with
different properties. We have never had a very sane story for what
would happen to such modified objects during dump/reload, and pg_upgrade
is no better (or worse). I don't think there's too much point in
thinking about plpgsql alone without also worrying about
* system views (including the information schema)
* collations
* conversions
* text search dictionaries
Now for a lot of this stuff, it's perhaps reasonable that a major
version upgrade would restore the objects to standard state. I'm
thinking though that it's rather bad that we treat either the public
schema or the plpgsql language that way. In particular, an admin
might have wished to remove or restrict those two objects for security
reasons, in which case he'd not be very happy if pg_upgrade resurrected
them or restored their default permissions.
BTW, I think your proposed fix doesn't work even without considering
this angle --- it would prevent creation of the duplicate pg_extension
row, but the binary-upgrade dump script is still going to try to create
the extension's member 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-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, bruce@momjian.us, m.sakrejda@gmail.com
Subject: Re: BUG #6706: pg_upgrade fails when plpgsql dropped/re-created
In-Reply-To: <14513.1341081467@sss.pgh.pa.us>
References: <E1SjIEG-0007Xu-PW@wrigleys.postgresql.org> <20120630015430.GA912@momjian.us> <336.1341027315@sss.pgh.pa.us> <20120630050007.GA20759@momjian.us> <11221.1341069176@sss.pgh.pa.us> <20120630162858.GC20759@momjian.us> <14513.1341081467@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