Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: [Q] what difference between PK and unique index + not NULL??
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
-- http://www.freelists.org/webpage/oracle-l -- http://www.freelists.org/webpage/oracle-l -- http://www.freelists.org/webpage/oracle-lReceived on Tue Jan 18 2005 - 21:50:34 CST
![]() |
![]() |