Unique Constraint vs Unique Index

Поиск
Список
Период
Сортировка
От JORGE MALDONADO
Тема Unique Constraint vs Unique Index
Дата
Msg-id CAAY=A7-2us_KLeqeYO98qfg0zOW1+2rHzscDvC-ZpWEOMdYYRg@mail.gmail.com
обсуждение исходный текст
Ответы Re: Unique Constraint vs Unique Index  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Re: Unique Constraint vs Unique Index  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-novice
Hi,

I have been reading about "unique constraint" and "unique index" in PostgreSQL documentation and also did some search in Google. However, it is not very clear to me which one to use or when to use one or the other. I understand that a "unique constraint" creates a "unique index" under the hood. So, at the end, both will check for duplicate records based on the field(s) specified for the unique constraint and the unique index.

What would be a guideline about when to use one or the other?

Respectfully,
Jorge Maldonado

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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: ON CONFLlCT DO UPDATE command cannot affect row a second time
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Unique Constraint vs Unique Index