Re: Patch to add a primary key using an existing index

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Gurjeet Singh <singh.gurjeet@gmail.com>
Cc: Peter Eisentraut <peter_e@gmx.net>, Robert Haas <robertmhaas@gmail.com>, r t <pgsql@xzilla.net>, Itagaki Takahiro <itagaki.takahiro@gmail.com>, Steve Singer <ssinger@ca.afilias.info>, Steve Singer <ssinger_pg@sympatico.ca>, PGSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2010-12-09T19:48:48Z
Lists: pgsql-hackers
Gurjeet Singh <singh.gurjeet@gmail.com> writes:
> But I still hold a bias towards renaming the index to match constraint name
> (with a NOTICE), rather than require that the constraint name match the
> index name, because the constraint name is optional and when it is not
> provided system has to generate a name and we have to rename the index
> anyway to maintain consistency.

No.  If the constraint name is not specified, we should certainly use
the existing index name, not randomly rename it.

			regards, tom lane