public inbox for [email protected]
help / color / mirror / Atom feedFrom: Alvaro Herrera <[email protected]>
To: JORGE MALDONADO <[email protected]>
Cc: pgsql-novice <[email protected]>
Subject: Re: Unique Constraint vs Unique Index
Date: Tue, 5 May 2020 16:32:29 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAAY=A7-2us_KLeqeYO98qfg0zOW1+2rHzscDvC-ZpWEOMdYYRg@mail.gmail.com>
On 2020-May-05, JORGE MALDONADO wrote:
> 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?
BTW you already asked this in October 2013 and got good answers.
https://postgr.es/m/CAAY=A78oJ--0aPm4E6ASJ32Z3UHk0nOqHQ_SvrtjOmq7i=UKDQ@mail.gmail.com
You had already asked in July 2013, too.
https://postgr.es/m/CAAY=A78V1gCxC6VEU4_G8e0XouT=c64RA2GaSfGE8MEy3=33_g@mail.gmail.com
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
view thread (3+ messages)
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected]
Subject: Re: Unique Constraint vs Unique Index
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox