Re: BUG #6706: pg_upgrade fails when plpgsql dropped/re-created

From: cowwoc <cowwoc(at)bbs(dot)darktech(dot)org>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #6706: pg_upgrade fails when plpgsql dropped/re-created
Date: 2015-01-12 20:58:30
Message-ID: 1421096310746-5833673.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message koizumistr 2015-01-13 13:22:01 BUG #12534: missing 'with' at X055
Previous Message Andres Freund 2015-01-12 18:19:16 Re: BUG #6706: pg_upgrade fails when plpgsql dropped/re-created