Re: Setting a pre-existing index as a primary key

Поиск
Список
Период
Сортировка
Искать
От
Tom Lane
Тема
Re: Setting a pre-existing index as a primary key
Дата
Msg-id
10889.1207703051@sss.pgh.pa.us
Ответ на
Список
Дерево обсуждения
Setting a pre-existing index as a primary key "Jonah H. Harris" <jonah.harris@gmail.com>
Re: Setting a pre-existing index as a primary key Tom Lane <tgl@sss.pgh.pa.us>
Re: Setting a pre-existing index as a primary key "Jonah H. Harris" <jonah.harris@gmail.com>
Re: Setting a pre-existing index as a primary key "Jaime Casanova" <systemguards@gmail.com>
Re: Setting a pre-existing index as a primary key Mario Weilguni <mweilguni@sime.com>
Re: Setting a pre-existing index as a primary key Bruce Momjian <bruce@momjian.us>
Re: Setting a pre-existing index as a primary key "Joshua D. Drake" <jd@commandprompt.com>
Re: Setting a pre-existing index as a primary key Tom Lane <tgl@sss.pgh.pa.us>
Re: Setting a pre-existing index as a primary key "Joshua D. Drake" <jd@commandprompt.com>
Re: Setting a pre-existing index as a primary key Tom Lane <tgl@sss.pgh.pa.us>
Re: Setting a pre-existing index as a primary key "Joshua D. Drake" <jd@commandprompt.com>
Re: Setting a pre-existing index as a primary key Bruce Momjian <bruce@momjian.us>
Re: Setting a pre-existing index as a primary key Tom Lane <tgl@sss.pgh.pa.us>
Re: Setting a pre-existing index as a primary key Andrew Dunstan <andrew@dunslane.net>
Re: Setting a pre-existing index as a primary key Tom Lane <tgl@sss.pgh.pa.us>
Re: Setting a pre-existing index as a primary key Andrew Sullivan <ajs@commandprompt.com>
Re: Setting a pre-existing index as a primary key David Fetter <david@fetter.org>
Re: Setting a pre-existing index as a primary key "Joshua D. Drake" <jd@commandprompt.com>
Re: Setting a pre-existing index as a primary key "Jonah H. Harris" <jonah.harris@gmail.com>
Re: Setting a pre-existing index as a primary key Gregory Stark <stark@enterprisedb.com>
Re: Setting a pre-existing index as a primary key "Jonah H. Harris" <jonah.harris@gmail.com>
Re: Setting a pre-existing index as a primary key Andrew Dunstan <andrew@dunslane.net>
Re: Setting a pre-existing index as a primary key Tom Lane <tgl@sss.pgh.pa.us>
Re: Setting a pre-existing index as a primary key Andrew Dunstan <andrew@dunslane.net>
Re: Setting a pre-existing index as a primary key Tino Wildenhain <tino@wildenhain.de>
"Jonah H. Harris"  writes:
> I've run into a couple cases now where it would be helpful to easily
> assign an already-existing unique index as a primary key.

You need to present a more convincing use-case than this unsupported
assertion.  There's hardly any effective difference between a unique
index + NOT NULL constraints and a declared primary key ... so what
did you really need it for?

> 1. Verify that the index named is a unique index

... and not partial, and not on expressions, and not invalid, and not
using non-default opclasses (which might have a surprising definition of
"equal"), and not already owned by a constraint ... not to mention that
it'd better be an index on the named table, which among other things
removes the need for a schema specification on the index name.
		regards, tom lane

В списке pgsql-hackers по дате отправления
От: Bruce Momjian
Дата:
От: Joshua D. Drake
Дата:
FAQ