Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 754131337BA8 for ; Wed, 20 Apr 2011 09:51:51 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 56330-08 for ; Wed, 20 Apr 2011 12:51:51 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from wwwmaster.postgresql.org (wwwmaster.postgresql.org [217.196.146.204]) by mail.postgresql.org (Postfix) with ESMTP id A232E1337B93 for ; Wed, 20 Apr 2011 09:51:50 -0300 (ADT) Received: from wwwmaster.postgresql.org (wwwmaster.postgresql.org [217.196.146.204]) by wwwmaster.postgresql.org (8.14.3/8.14.3) with ESMTP id p3KCpoUH062446 for ; Wed, 20 Apr 2011 12:51:50 GMT (envelope-from www@wwwmaster.postgresql.org) Received: (from www@localhost) by wwwmaster.postgresql.org (8.14.3/8.14.3/Submit) id p3KCpox7062445; Wed, 20 Apr 2011 12:51:50 GMT (envelope-from www) Date: Wed, 20 Apr 2011 12:51:50 GMT Message-Id: <201104201251.p3KCpox7062445@wwwmaster.postgresql.org> To: pgsql-bugs@postgresql.org Subject: BUG #5988: CTINE duplicates constraints From: "Marko Tiikkaja" Content-Type: text/plain; charset=utf-8 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 201104/142 X-Sequence-Number: 30061 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.