Re: Recreating unique index for primary key

Поиск
Список
Период
Сортировка
От Tod McQuillin
Тема Re: Recreating unique index for primary key
Дата
Msg-id 20010930002004.C11516-100000@glass.pun-pun.prv
обсуждение исходный текст
Ответ на Re: Recreating unique index for primary key  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Recreating unique index for primary key
Список pgsql-general
On Sat, 29 Sep 2001, Tom Lane wrote:

> CREATE UNIQUE INDEX is fine as far as the database goes.  Offhand it
> looks like the only extra thing a primary-key marker does is to define
> the default reference column for subsequent foreign-key references
> pointing at your table.
>
> If you want, you can reach into pg_index and set the indisprimary field
> after creating the index:

I stand corrected; there *is* something in the index itself which marks it
primary.

I'd guess that since the only time 'REFERENCES' is seen is when creating a
new table (and translated into hard-coded triggers after that), you should
be fine until you create a new table referencing the table whose primary
index you removed.

It's an inconsistency I would not feel comfortable with, so I'm glad I
learned about indisprimary.  Is this documented anywhere?
--
Tod McQuillin




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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Encoding passwords
Следующее
От: Tod McQuillin
Дата:
Сообщение: Re: Recreating unique index for primary key