Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: relationship between unique index and constraint
RE: relationship between unique index and constraintThat's correct. Thank
you, Jacques.
Arup
----- Original Message -----
To: Multiple recipients of list ORACLE-L
Sent: Friday, April 18, 2003 5:06 PM
One more detail:
"But since Oracle used that index to enforce the unique constraint, it was
dropped to un-enforce the constraint."
However if the enforcing index for the PK or unique constraint is not a
unique index, it will not be dropped along with the PK or unique constraint.
-----Original Message-----
Here is the lowdown on the issue:
When you create a unique CONSTRAINT, Oracle creates a unique INDEX to
enforce it.
When you create a unique INDEX, a constraint is NOT automatically created,
but the rdbms engine reports the same message as if the constraint name was
violated.
So what happens when you create a unique INDEX first and then add a unique
CONSTRAINT of the same name later?
SQL> create unique index in_trans_01 on trans (col1);
Index created.
SQL> select index_name from user_indexes where table_name = 'TRANS';
INDEX_NAME
-- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Arup Nanda INET: orarup_at_hotmail.com Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting servicesReceived on Fri Apr 18 2003 - 17:06:41 CDT
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).