Re: Unique and Primary Key Constraints

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: Unique and Primary Key Constraints
Дата
Msg-id 200207130420.g6D4Kbx18208@candle.pha.pa.us
обсуждение исходный текст
Ответ на Unique and Primary Key Constraints  (Rod Taylor <rbt@zort.ca>)
Ответы Re: Unique and Primary Key Constraints  (Rod Taylor <rbt@zort.ca>)
Список pgsql-hackers
Rod Taylor wrote:
> I'm going to change the pg_dump command to pull these constraints out of
> pg_constaint where possible, creating the appropriate alter table add
> constraint command (see primary key).
> 
> 
> Should unique constraints created with 'create index' (no entry in
> pg_constraint) be re-created via alter table add constraint, or via
> create unique index? 

CREATE UNIQUE INDEX has optimization purpose as well as an constraint
purpose.  I think CREATE UNIQUE INDEX is the way to go.

> I prefer ...add constraint.  After a while (release or 2) removal of
> create unique index all together.

Remove CREATE UNIQUE INDEX entirely?  Why?

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


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

Предыдущее
От: Mark kirkwood
Дата:
Сообщение: Re: test data for query optimizer
Следующее
От: Rod Taylor
Дата:
Сообщение: Re: Unique and Primary Key Constraints