Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id BC35F1337BE6 for ; Wed, 20 Apr 2011 20:13:35 -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 62509-08 for ; Wed, 20 Apr 2011 23:13:28 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 49524133616B for ; Wed, 20 Apr 2011 20:13:28 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p3KNDPDF022051; Wed, 20 Apr 2011 19:13:25 -0400 (EDT) To: "Marko Tiikkaja" cc: pgsql-bugs@postgresql.org Subject: Re: BUG #5988: CTINE duplicates constraints In-reply-to: <201104201251.p3KCpox7062445@wwwmaster.postgresql.org> References: <201104201251.p3KCpox7062445@wwwmaster.postgresql.org> Comments: In-reply-to "Marko Tiikkaja" message dated "Wed, 20 Apr 2011 12:51:50 +0000" Date: Wed, 20 Apr 2011 19:13:25 -0400 Message-ID: <22050.1303341205@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201104/166 X-Sequence-Number: 30085 "Marko Tiikkaja" writes: > CREATE TABLE IF NOT EXISTS duplicates some constraints if the new table > isn't created: What this means is that the feature was implemented in the wrong place, ie the short-circuit is after rather than before parse_utilcmds.c splits up the CREATE TABLE command into multiple primitive actions. I have stated previously my opinion that this is a misconceived feature, and it's now apparent that the implementation is as poorly thought through as the definition. My recommendation is to revert that patch altogether. (BTW, before anyone suggests that s/continue/break/ would fix it, I suggest experimenting with a table containing a serial column.) regards, tom lane