Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: [Q] what difference between PK and unique index + not NULL??

RE: [Q] what difference between PK and unique index + not NULL??

From: Marquez, Chris <CMarquez_at_aarp.org>
Date: Tue, 18 Jan 2005 17:52:28 -0500
Message-ID: <7E412C164E6ECB468834A39F31E6E0D40666DB8A@mbs06dc.na.aarp.int>

I think the problem is; what is "logical" and what is "technical".

"Logically" I would say that; PK =3D Unique index + Not NULL.
But "Technically" the are very different...as others on the list have pointed out.

You can't have a FK point to a "Unique index + Not NULL" with out a PK constraint! That s a technical difference.

It is true that if you have a Unique index on your PK column that Oracle will just use that Unique index and NOT drop if even when you drop the PK constraint.

Also like this comment too; "Oracle can from version 8 up use non-unique indexes to implement PK constraints."

Tell your consultant he is "technical right, until the customer asks for a child table (FK) on the original table.  ;o)

Chris Marquez
Oracle DBA
HEYMONitor(tm) - heymonitor.com
"Oracle Monitoring & Alerting Solution"

-----Original Message-----
From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Powell, Mark D Sent: Tuesday, January 18, 2005 2:24 PM
To: oracle-l_at_freelists.org
Subject: RE: [Q] what difference between PK and unique index + not NULL?? The definition of a PK constraint is that it is a UK constraint plus the
"not null" constraint. Indexing is a technical implementation issue and
is not really part of the PK definition. After all Oracle can from verion 8 up use non-unique indexes to implement PK constraints.

-----Original Message-----
From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org]On Behalf Of dba1 mcc Sent: Tuesday, January 18, 2005 1:59 PM
To: oracle-l_at_freelists.org
Subject: [Q] what difference between PK and unique index + not NULL??

I have some argued with contractor about Primary key and Unique index + Not NULL. Contractor said Primary Key =3D (field specify NOT NLL and create unique index ..). I rember some documents say Primary Key and (unique index, not null) still some different.

Does anyone have opinion?

Thanks. =20

        =09

__________________________________=20

Do you Yahoo!?=20
Yahoo! Mail - Easier than ever with enhanced search. Learn more. http://info.mail.yahoo.com/mail_250
--
http://www.freelists.org/webpage/oracle-l
--
http://www.freelists.org/webpage/oracle-l
--
http://www.freelists.org/webpage/oracle-l
Received on Tue Jan 18 2005 - 21:50:34 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US