pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Marko Tiikkaja <marko.tiikkaja@2ndquadrant.com>
To: pgsql-bugs@postgresql.org
Subject: BUG #5988: CTINE duplicates constraints
Date: Wed, 20 Apr 2011 12:51:50 GMT
Message-ID: <201104201251.p3KCpox7062445@wwwmaster.postgresql.org> (raw)


The following bug has been logged online:

Bug reference:      5988
Logged by:          Marko Tiikkaja
Email address:      marko.tiikkaja@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.



view thread (5+ messages)  latest in thread

Message-ID: <201104201251.p3KCpox7062445@wwwmaster.postgresql.org>
Permalink:  ../201104201251.p3KCpox7062445@wwwmaster.postgresql.org/
Also on:    postgresql.org/message-id/201104201251.p3KCpox7062445@wwwmaster.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: marko.tiikkaja@2ndquadrant.com
  Subject: Re: BUG #5988: CTINE duplicates constraints
  In-Reply-To: <201104201251.p3KCpox7062445@wwwmaster.postgresql.org>
  References: <201104201251.p3KCpox7062445@wwwmaster.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox