Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 85EDE1B5EC5C for ; Sat, 30 Jun 2012 13:29:14 -0300 (ADT) Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Sl0Xo-00074Z-S2 for pgsql-bugs@postgresql.org; Sat, 30 Jun 2012 16:29:13 +0000 Received: from bruce by momjian.us with local (Exim 4.72) (envelope-from ) id 1Sl0Xa-00057g-Kk; Sat, 30 Jun 2012 12:28:58 -0400 Date: Sat, 30 Jun 2012 12:28:58 -0400 From: Bruce Momjian To: Tom Lane Cc: m.sakrejda@gmail.com, pgsql-bugs@postgresql.org Subject: Re: BUG #6706: pg_upgrade fails when plpgsql dropped/re-created Message-ID: <20120630162858.GC20759@momjian.us> References: <20120630015430.GA912@momjian.us> <336.1341027315@sss.pgh.pa.us> <20120630050007.GA20759@momjian.us> <11221.1341069176@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <11221.1341069176@sss.pgh.pa.us> User-Agent: Mutt/1.5.20 (2009-06-14) X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201206/248 X-Sequence-Number: 33475 On Sat, Jun 30, 2012 at 11:12:56AM -0400, Tom Lane wrote: > Bruce Momjian writes: > > On Fri, Jun 29, 2012 at 11:35:15PM -0400, Tom Lane wrote: > >> I think you're misjudging the core of the issue. The same thing > >> would happen if somebody dropped and recreated the public schema. > >> Or anything else that we create at initdb time but allow to be > >> dropped. > > > I just tested dropping and recreating the 'public' schema and pg_upgrade > > worked fine. > > Did it restore the nonstandard ownership of the schema? Your proposed > fix for plpgsql won't preserve the previous state of the extension. > (Maybe we don't care, but it needs consideration.) My point was that drop/create of the public schema does not generate a pg_upgrade error like plpgsql does. Let me address the schema question here and the plpgsql issue in the next email. > Did it restore the nonstandard ownership of the schema? No --- drop/create of the public schema produces: test=> \dn+ List of schemas Name | Owner | Access privileges | Description --------+----------+-------------------+------------- public | postgres | | (1 row) while the original shipped public and the post-upgrade of a drop/created schema are: test=> \dn+ List of schemas Name | Owner | Access privileges | Description --------+----------+----------------------+------------------------ public | postgres | postgres=UC/postgres+| standard public schema | | =UC/postgres | (1 row) However, surprisingly, a simple pg_dump/restore also does not preserve the public schema permissions either. :-( -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + It's impossible for everything to be true. +