Re: Patch to add a primary key using an existing index
eggyknap <eggyknap@gmail.com>
From: Joshua Tolley <eggyknap@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Steve Singer <ssinger_pg@sympatico.ca>, Gurjeet Singh <singh.gurjeet@gmail.com>, PGSQL Hackers <pgsql-hackers@postgresql.org>, Peter Eisentraut <peter_e@gmx.net>, Robert Haas <robertmhaas@gmail.com>, r t <pgsql@xzilla.net>, Itagaki Takahiro <itagaki.takahiro@gmail.com>
Date: 2011-01-25T17:59:09Z
Lists: pgsql-hackers
On Mon, Jan 24, 2011 at 07:01:13PM -0500, Tom Lane wrote: > One other issue that might be worthy of discussion is that as things > stand, execution of the ADD CONSTRAINT USING INDEX syntax will cause > the constraint to absorb the index as an INTERNAL dependency. That > means dropping the constraint would make the index go away silently --- > it no longer has any separate life. If the intent is just to provide a > way to get the effect of ALTER ADD PRIMARY KEY CONCURRENTLY, then this > behavior is probably fine. But someone who believes DROP CONSTRAINT > exactly reverses the effects of ADD CONSTRAINT might be surprised. > Comments? So you'd manually create an index, attach it to a constraint, drop the constraint, and find that the index had disappeared? ISTM since you created the index explicitly, you should have to drop it explicitly as well. -- Joshua Tolley / eggyknap End Point Corporation http://www.endpoint.com