Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id E82D316DF813 for ; Mon, 2 Jul 2012 14:02:07 -0300 (ADT) Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Slk0j-0005IG-NB for pgsql-bugs@postgresql.org; Mon, 02 Jul 2012 17:02:07 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id q62H1pLu019242; Mon, 2 Jul 2012 13:01:51 -0400 (EDT) From: Tom Lane To: Bruce Momjian cc: m.sakrejda@gmail.com, pgsql-bugs@postgresql.org Subject: Re: BUG #6706: pg_upgrade fails when plpgsql dropped/re-created In-reply-to: <20120702154211.GA25966@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> Comments: In-reply-to Bruce Momjian message dated "Mon, 02 Jul 2012 11:42:11 -0400" Date: Mon, 02 Jul 2012 13:01:51 -0400 Message-ID: <19241.1341248511@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201207/5 X-Sequence-Number: 33481 Bruce Momjian writes: > + > + /* > + * We unconditionally create the extension, so we must drop it if it > + * exists. This could happen if the user deleted 'plpgsql' and then > + * readded it, causing its oid to be greater than FirstNormalObjectId. > + */ > + appendPQExpBuffer(q, "DROP EXTENSION IF EXISTS %s;\n", qextname); This doesn't seem like anything but a wart :-(. It's unlike the behavior for every other kind of object, it introduces the inconsistent behavior even in non-binary-upgrade cases, and it does nothing at all to address the points I made about reproducing the previous state in cases where the admin removed the language or changed its permissions. regards, tom lane