Re: CREATE TABLE LIKE INCLUDING INDEXES support - Mailing list pgsql-patches

From NikhilS
Subject Re: CREATE TABLE LIKE INCLUDING INDEXES support
Date
Msg-id d3c4af540705180026o3921849cicc17c02fcc593ec@mail.gmail.com
Whole thread Raw
In response to Re: CREATE TABLE LIKE INCLUDING INDEXES support  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: CREATE TABLE LIKE INCLUDING INDEXES support
List pgsql-patches
Hi,


[ remembering previous discussions more clearly... ]  Actually there
is a concrete problem here: unique constraints are supposed to be
represented in the information_schema views, and there is no
spec-compliant way to do that for a constraint on something other than
a column.  We'd have to guess at what the SQL committee would do about
that, and the odds of guessing exactly right don't seem encouraging.

Considering that a unique index is a unique constraint, then isn't allowing expressional unique indexes contradictory to the above?

It seems that "CREATE UNIQUE INDEX" currently does not pass isconstraint as true to DefineIndex, otherwise  index_create() would have cribbed with:

"constraints cannot have index expressions" error.

Since this patch is going to consider creating unique/primary indexes assuming them to be constraints, IMHO we should be uniform about unique constraints semantics.

That might mean that we only support expressionless, non-predicate indexes via "INCLUDING CONSTRAINTS"?

Regards,
Nikhils

--
EnterpriseDB               http://www.enterprisedb.com

pgsql-patches by date:

Previous
From: "Pavel Stehule"
Date:
Subject: Re: Updateable cursors patch
Next
From: Heikki Linnakangas
Date:
Subject: Re: Seq scans status update