Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YAm4L-000536-Uv for pgsql-bugs@arkaria.postgresql.org; Mon, 12 Jan 2015 20:58:38 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YAm4L-0006jp-AN for pgsql-bugs@arkaria.postgresql.org; Mon, 12 Jan 2015 20:58: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 1YAm4K-0006ji-AC for pgsql-bugs@postgresql.org; Mon, 12 Jan 2015 20:58:36 +0000 Received: from mwork.nabble.com ([162.253.133.43]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YAm4G-0006mS-Gl for pgsql-bugs@postgresql.org; Mon, 12 Jan 2015 20:58:34 +0000 Received: from msam.nabble.com (unknown [162.253.133.85]) by mwork.nabble.com (Postfix) with ESMTP id 0F658104C395 for ; Mon, 12 Jan 2015 12:58:32 -0800 (PST) Date: Mon, 12 Jan 2015 13:58:30 -0700 (MST) From: cowwoc To: pgsql-bugs@postgresql.org Message-ID: <1421096310746-5833673.post@n5.nabble.com> In-Reply-To: <20150112181916.GG2092@awork2.anarazel.de> References: <20120706233441.GA26828@momjian.us> <20120707144544.GF26828@momjian.us> <20120710214326.GA6315@momjian.us> <1418162132845-5829814.post@n5.nabble.com> <25623.1418162623@sss.pgh.pa.us> <1418163196370-5829821.post@n5.nabble.com> <26324.1418163943@sss.pgh.pa.us> <20150112181916.GG2092@awork2.anarazel.de> 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 Andres Freund-3 wrote > cowwoc just talked about this on irc, and the explanation very likely is > that the extension commands are run in parallel on several > connections. > > Greetings, > > Andres Freund Correct. Executing CREATE EXTENSION IF NOT EXISTS hstore SCHEMA public concurrently from multiple connections triggers the error in question. Andres suggested the following workaround which worked for me: LOCK pg_extension; CREATE EXTENSION IF NOT EXISTS hstore SCHEMA public; Meaning, simply lock pg_extension before attempting to create the extension. Gili -- View this message in context: http://postgresql.nabble.com/BUG-6706-pg-upgrade-fails-when-plpgsql-dropped-re-created-tp5714220p5833673.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