Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: unique contraint without index
Jaap W. van Dijk wrote:
> On 16 Jan 2007 06:06:39 -0800, "sybrandb" <sybrandb_at_gmail.com> wrote:
>
>
>> A primary key without any index just doesn't make sense. >> Nor does your nick. >>
That is a special case only valid when using a non-deferrable constraint and/or when the constraint is built using a unique index (rather than a non-unique) index.
SQL> ALTER TABLE t
2 ADD CONSTRAINT pk_t
3 PRIMARY KEY (testcol)
4 DEFERRABLE INITIALLY DEFERRED
5 USING INDEX;
SQL> ALTER TABLE t
2 MODIFY CONSTRAINT pk_t
3 DISABLE NOVALIDATE;
Table altered.
SQL> select constraint_name from user_constraints where table_name = 'T';
CONSTRAINT_NAME
SQL> select index_name from user_indexes where table_name = 'T';
INDEX_NAME
SQL>
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace x with u to respond) Puget Sound Oracle Users Group www.psoug.orgReceived on Tue Jan 16 2007 - 17:09:04 CST