Skip site navigation (1) Skip section navigation (2)

BUG #5988: CTINE duplicates constraints

From: "Marko Tiikkaja" <marko(dot)tiikkaja(at)2ndquadrant(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #5988: CTINE duplicates constraints
Date: 2011-04-20 12:51:50
Message-ID: 201104201251.p3KCpox7062445@wwwmaster.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      5988
Logged by:          Marko Tiikkaja
Email address:      marko(dot)tiikkaja(at)2ndquadrant(dot)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.

Responses

pgsql-bugs by date

Next:From: Tom LaneDate: 2011-04-20 13:11:16
Subject: Re: BUG #5985: CLUSTER ... USING can fail with ERROR: index xxx does not belong to table yyy
Previous:From: Joshua TolleyDate: 2011-04-20 09:45:26
Subject: Re: BUG #5966: extract(epoch..) function error

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group