Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XySks-0003fT-Aa for pgsql-bugs@arkaria.postgresql.org; Tue, 09 Dec 2014 21:55:38 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XySkr-0005dg-Pd for pgsql-bugs@arkaria.postgresql.org; Tue, 09 Dec 2014 21:55:37 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XySkq-0005bJ-Mu for pgsql-bugs@postgresql.org; Tue, 09 Dec 2014 21:55:36 +0000 Received: from mwork.nabble.com ([162.253.133.43]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XySkn-0000cf-Eb for pgsql-bugs@postgresql.org; Tue, 09 Dec 2014 21:55:34 +0000 Received: from msam.nabble.com (unknown [162.253.133.85]) by mwork.nabble.com (Postfix) with ESMTP id 204CCD2C6B0 for ; Tue, 9 Dec 2014 13:55:33 -0800 (PST) Date: Tue, 9 Dec 2014 14:55:32 -0700 (MST) From: cowwoc To: pgsql-bugs@postgresql.org Message-ID: <1418162132845-5829814.post@n5.nabble.com> In-Reply-To: <20120710214326.GA6315@momjian.us> References: <20120702172836.GB25966@momjian.us> <20120704213703.GH5578@momjian.us> <9917.1341462118@sss.pgh.pa.us> <20120705133253.GJ5578@momjian.us> <20120706233441.GA26828@momjian.us> <20120707144544.GF26828@momjian.us> <20120710214326.GA6315@momjian.us> Subject: Re: BUG #6706: pg_upgrade fails when plpgsql dropped/re-created MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Bruce Momjian wrote > On Tue, Jul 10, 2012 at 01:03:18PM -0700, Maciek Sakrejda wrote: >> So, is there hope of a better fix here for 9.2 (specifically for >> preserving extension ownership on pg_upgrade and dump/restore, though >> I understand it may not make sense to do that if we can't fix a number >> of related issues)? If not, is the below catalog-twiddling sane, >> lacking an ALTER EXTENSION foo OWNER TO ...? >> >> postgres=# update pg_extension set extowner = (select oid from >> pg_roles where rolname = 'maciek') where extname = 'plpgsql'; > > There is no hope that any changes to extensions will be preserved across > upgrades any better than it was in 9.1 --- the change is only that > pg_upgrade will not fail. Hi, I am running into a similar problem without using pg_upgrade. My application invokes: DROP EXTENSION IF EXISTS hstore CASCADE followed by: CREATE EXTENSION IF NOT EXISTS hstore SCHEMA public and I get: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "pg_extension_name_index" Detail: Key (extname)=(hstore) already exists. at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2198) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1927) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:561) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:405) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:397) [snip] Where do we go from here? Thanks, Gili -- View this message in context: http://postgresql.nabble.com/BUG-6706-pg-upgrade-fails-when-plpgsql-dropped-re-created-tp5714220p5829814.html Sent from the PostgreSQL - bugs mailing list archive at Nabble.com. -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs