Re: Patch to add a primary key using an existing index
| От | Josh Berkus |
|---|---|
| Тема | Re: Patch to add a primary key using an existing index |
| Дата | |
| Msg-id | 4CF96418.1050700@agliodbs.com обсуждение исходный текст |
| Ответ на | Re: Patch to add a primary key using an existing index (Robert Haas <robertmhaas@gmail.com>) |
| Ответы |
Re: Patch to add a primary key using an existing index
|
| Список | pgsql-hackers |
On 12/3/10 12:27 PM, 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.
Seems unlikely to cause confusion to me.
However, I don't see why we need (column_list). Surely the index has a
column list already?
ALTER TABLE table_name ADD CONSTRAINT pk_name PRIMARY KEY USING index_name
... seems like the syntax most consistent with the existing commands.
Anything else would be confusingly inconsistent with the way you add a
brand-new PK.
-- -- Josh Berkus PostgreSQL Experts Inc.
http://www.pgexperts.com
В списке pgsql-hackers по дате отправления: