Re: Recreating unique index for primary key

Поиск
Список
Период
Сортировка
От Tod McQuillin
Тема Re: Recreating unique index for primary key
Дата
Msg-id 20010929170228.Y11516-100000@glass.pun-pun.prv
обсуждение исходный текст
Ответ на Recreating unique index for primary key  (Ryan Ho <ryanho@pacific.net.sg>)
Список pgsql-general
On Fri, 28 Sep 2001, Ryan Ho wrote:

> I've dropped an primary key index in order to re-create it. but i realized
> that i can't recreate a primary key index. Will a unique index be an adequate
> replacement? will the database integrity be at risk as a result?

I think that 'PRIMARY KEY' in a table definition is just shorthand for
'UNIQUE NOT NULL', in addition to whatever magic is required to mark the
column as primary so that 'REFERENCES' constraints in other tables know
which column to default to.

If all you did was delete the index and recreate it, you should be fine --
as far as I know there is nothing in the index itself marking it as
"primary".
--
Tod McQuillin

P.S.  If I am wrong or incomplete in my speculations above, I am sure
someone will jump in and correct me, which is exactly what I'm hoping for.
The best way to get correct answers on a mailing list is to post wrong
answers :-)



В списке pgsql-general по дате отправления:

Предыдущее
От: "lt"
Дата:
Сообщение: Copy error?
Следующее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: Performance question (stripped down the problem)