Re: BUG #9956: Concurrency bug in CREATE TABLE IF NOT EXISTS statement

From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: christian(at)schlichtherle(dot)de, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #9956: Concurrency bug in CREATE TABLE IF NOT EXISTS statement
Date: 2014-04-11 19:55:01
Message-ID: 53484895.80209@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 04/11/2014 05:51 PM, christian(at)schlichtherle(dot)de wrote:
> The following bug has been logged on the website:
>
> Bug reference: 9956
> Logged by: Christian Schlichtherle
> Email address: christian(at)schlichtherle(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Vik Fearing 2014-04-11 21:07:54 Re: BUG #9955: The time zone value for South Africa (SAST) is 01:00:00 not 09:30:00
Previous Message Tom Lane 2014-04-11 16:54:37 Re: BUG #9955: The time zone value for South Africa (SAST) is 01:00:00 not 09:30:00