Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id D74F8A0FB34 for ; Wed, 4 Jul 2012 18:37:17 -0300 (ADT) Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SmXG8-0006oF-Qo for pgsql-bugs@postgresql.org; Wed, 04 Jul 2012 21:37:17 +0000 Received: from bruce by momjian.us with local (Exim 4.72) (envelope-from ) id 1SmXFv-000598-5M; Wed, 04 Jul 2012 17:37:03 -0400 Date: Wed, 4 Jul 2012 17:37:03 -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: <20120704213703.GH5578@momjian.us> References: <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> <20120702154211.GA25966@momjian.us> <19241.1341248511@sss.pgh.pa.us> <20120702172836.GB25966@momjian.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120702172836.GB25966@momjian.us> User-Agent: Mutt/1.5.20 (2009-06-14) X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201207/18 X-Sequence-Number: 33494 On Mon, Jul 02, 2012 at 01:28:36PM -0400, Bruce Momjian wrote: > This is the trimmed-down code block: > > if (!binary_upgrade) > { > appendPQExpBuffer(q, "CREATE EXTENSION IF NOT EXISTS %s WITH SCHEMA %s;\n", > qextname, fmtId(extinfo->namespace)); > } > else > { > --> appendPQExpBuffer(q, "DROP EXTENSION IF EXISTS %s;\n", qextname); > appendPQExpBuffer(q, > "SELECT binary_upgrade.create_empty_extension("); > > The idea is that the IF NOT EXISTS and IF EXISTS are symmetric, which is > my goal. > > > address the points I made about reproducing the previous state in cases > > where the admin removed the language or changed its permissions. > > Well, it still does the create extension in binary mode like before --- > not sure what the problem is. Applied and back-patched to 9.2. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + It's impossible for everything to be true. +