Re: BUG #5988: CTINE duplicates constraints - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #5988: CTINE duplicates constraints
Date
Msg-id 22050.1303341205@sss.pgh.pa.us
Whole thread Raw
In response to BUG #5988: CTINE duplicates constraints  ("Marko Tiikkaja" <marko.tiikkaja@2ndquadrant.com>)
Responses Re: BUG #5988: CTINE duplicates constraints  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-bugs
"Marko Tiikkaja" <marko.tiikkaja@2ndquadrant.com> 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

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #5985: CLUSTER ... USING can fail with ERROR: index xxx does not belong to table yyy
Next
From: Stephen Frost
Date:
Subject: Re: BUG #5990: 100% CPU reached