Unique Index vs. Unique Constraint

Started by Thomas LeBlancover 22 years ago5 messagesgeneral
Jump to latest
#1Thomas LeBlanc
thomasatiem@hotmail.com

Does a Unique Constraint build a unique index?

What is the difference?

Thanks,
Thomas LeBlanc

_________________________________________________________________
Get a FREE computer virus scan online from McAfee.
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

#2Manfred Koizar
mkoi-pg@aon.at
In reply to: Thomas LeBlanc (#1)
Re: Unique Index vs. Unique Constraint

On Fri, 10 Oct 2003 13:59:38 -0500, "Thomas LeBlanc"
<thomasatiem@hotmail.com> wrote:

Does a Unique Constraint build a unique index?

Yes.

What is the difference?

A constraint is an abstract concept, an index is an implementation
detail.

Servus
Manfred

#3scott.marlowe
scott.marlowe@ihs.com
In reply to: Thomas LeBlanc (#1)
Re: Unique Index vs. Unique Constraint

On Fri, 10 Oct 2003, Thomas LeBlanc wrote:

Does a Unique Constraint build a unique index?

What is the difference?

None that I know of.

#4Thomas LeBlanc
thomasatiem@hotmail.com
In reply to: scott.marlowe (#3)
Re: Unique Index vs. Unique Constraint

Then what is the difference in these two statements?

alter table Table1
add constraint Table1_UC1
unique (Field1, Field2)

and

create unique index Table1_Field1Field2
on Table1 (Field1, Field2)

Thanks,
Thomas LeBlanc

From: Dennis Gearon <gearond@fireserve.net>
To: Thomas LeBlanc <thomasatiem@hotmail.com>
Subject: Re: [GENERAL] Unique Index vs. Unique Constraint
Date: Fri, 10 Oct 2003 15:16:12 -0700

Uniquely so!

Thomas LeBlanc wrote:

Does a Unique Constraint build a unique index?

What is the difference?

Thanks,
Thomas LeBlanc

_________________________________________________________________
Get a FREE computer virus scan online from McAfee.
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

_________________________________________________________________
Help protect your PC. Get a FREE computer virus scan online from McAfee.
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

#5Jan Wieck
JanWieck@Yahoo.com
In reply to: scott.marlowe (#3)
Re: Unique Index vs. Unique Constraint

scott.marlowe wrote:

On Fri, 10 Oct 2003, Thomas LeBlanc wrote:

Does a Unique Constraint build a unique index?

What is the difference?

None that I know of.

A different implementation of UNIQUE constraint might allow
deferrability, what our index solution does not ... yet.

Jan

--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck@Yahoo.com #