Ads were blocked - no problem. But keep in mind that developing HeidiSQL, user support and hosting takes time and money. You may want to send a donation instead.

Unique over 2 columns

ecxod's profile image ecxod posted 3 months ago in General Permalink

I am not sure but as far as I know a unique over 2 columns should accept a distinct entry only once in both columns.

Description

So basically in my example if I add a email in column eml, I should not be able to add the same email again in column emlreq.

If this is correct? If yes we have a bug.

ansgar's profile image ansgar posted 3 months ago Permalink

No, in a unique key, the combination of its values is unique over the whole table. So both columns can happily have the same values, as long as there is no other row containing the same combination:

eml emlreq
abc abc valid
def abc valid
def def valid
def def invalid duplicate to prior row!
justrusty's profile image justrusty posted 2 months ago Permalink

This isn't even a bug. It's just user error. I think this "birdshit" can be closed now. There are more important real bugs and feature requests.

ecxod's profile image ecxod posted 2 months ago Permalink

Ansgar, I hope I don't see this face in this forum anymore.

Please login to leave a reply, or register at first.