Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread Unique constraint not checked
Tue, Feb 27 2007 8:11 PMPermanent Link

"Ole Willy Tuv"
create table test (c1 integer not null)

insert into test values (1)

insert into test values (1)

alter table test
add constraint pk_test primary key (c1)

alter table test
add constraint uc_test_c1 unique (c1)

Both ALTER TABLE statements execute without errors on the constraint
violation.

Another and separate issue is that the second unique constraint definition
is invalid even if the table did not contain duplicate rows, since only one
unique constraint can be defined on the same set of columns.

Ole Willy Tuv

Wed, Feb 28 2007 9:21 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Ole,

<< Both ALTER TABLE statements execute without errors on the constraint
violation. >>

Same issue as your other two posts.

<< Another and separate issue is that the second unique constraint
definition is invalid even if the table did not contain duplicate rows,
since only one unique constraint can be defined on the same set of columns.
>>

EDB doesn't currently prevent this, since there really is no great harm in
allowing it.  However, I'll add it to the list.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image