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

Peter Eisentraut <peter_e@gmx.net>

From: Peter Eisentraut <peter_e@gmx.net>
To: Robert Haas <robertmhaas@gmail.com>
Cc: r t <pgsql@xzilla.net>, Itagaki Takahiro <itagaki.takahiro@gmail.com>, Gurjeet Singh <singh.gurjeet@gmail.com>, Steve Singer <ssinger@ca.afilias.info>, Steve Singer <ssinger_pg@sympatico.ca>, PGSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2010-12-05T19:09:31Z
Lists: pgsql-hackers
On fre, 2010-12-03 at 15:27 -0500, Robert Haas wrote:
> On Fri, Dec 3, 2010 at 2:56 PM, r t <pgsql@xzilla.net> wrote:
> > What exactly was the objection to the following -->
> > ALTER TABLE table_name ADD PRIMARY KEY (column_list) USING index_name;
> > Is the objection that you might have been trying to specify a constraint
> > named "using" ? I'm willing to make that option more difficult. :-)
> 
> I think it's that someone might expect the word after USING to be the
> name of an index AM.

That could be avoided by writing

USING INDEX <name>