Re: BUG #9956: Concurrency bug in CREATE TABLE IF NOT EXISTS statement - Mailing list pgsql-bugs

From Heikki Linnakangas
Subject Re: BUG #9956: Concurrency bug in CREATE TABLE IF NOT EXISTS statement
Date
Msg-id 53484895.80209@vmware.com
Whole thread Raw
In response to BUG #9956: Concurrency bug in CREATE TABLE IF NOT EXISTS statement  (christian@schlichtherle.de)
List pgsql-bugs
On 04/11/2014 05:51 PM, christian@schlichtherle.de wrote:
> The following bug has been logged on the website:
>
> Bug reference:      9956
> Logged by:          Christian Schlichtherle
> Email address:      christian@schlichtherle.de
> PostgreSQL version: 9.3.4
> Operating system:   Mac OS X 10.9.2
> Description:
>
> Apparently, the CREATE TABLE IF NOT EXISTS statement is not properly
> isolated. The following test exposes the issue using JDBC:
>
> <pre><code>
> ...
> </code></pre>
>
> The result of running this test is always the following exception stack
> trace.
>
> <pre><code>
> java.util.concurrent.ExecutionException: org.postgresql.util.PSQLException:
> ERROR: duplicate key value violates unique constraint
> "pg_type_typname_nsp_index"
>    Detail: Key (typname, typnamespace)=(foo, 2200) already exists.

Yeah, that's a known issue. See
http://www.postgresql.org/message-id/4F9541D3.1000202@beccati.com.

It's OK for normal DDL commands to rely on the constraint, but I agree
it's pretty surprising for IF NOT EXISTS.

- Heikki

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #9955: The time zone value for South Africa (SAST) is 01:00:00 not 09:30:00
Next
From: Vik Fearing
Date:
Subject: Re: BUG #9955: The time zone value for South Africa (SAST) is 01:00:00 not 09:30:00