The following bug has been logged online:

Bug reference:      5988
Logged by:          Marko Tiikkaja
Email address:      marko.tiikk...@2ndquadrant.com
PostgreSQL version: git master
Operating system:   Linux
Description:        CTINE duplicates constraints
Details: 

CREATE TABLE IF NOT EXISTS duplicates some constraints if the new table
isn't created:

=# create table foo(a int primary key);
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "foo_pkey"
for table "foo"
CREATE TABLE

=# create table if not exists foo(a int primary key);
NOTICE:  relation "foo" already exists, skipping
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "foo_pkey1"
for table "foo"
CREATE TABLE

=# \d foo
      Table "public.foo"
 Column |  Type   | Modifiers
--------+---------+-----------
 a      | integer | not null
Indexes:
    "foo_pkey" PRIMARY KEY, btree (a)
    "foo_pkey1" PRIMARY KEY, btree (a)

It seems to do that at least for PRIMARY KEY and UNIQUE constraints.

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Reply via email to