Hi guys,

I'm trying to create a multi-column unique constraint in SQLite, but I don't
have success. In table "players", I've created the following index:

    CREATE UNIQUE INDEX "players_unique" ON "players" ("id" ASC, "skill"
ASC, "stagione" ASC, "settimana" ASC)

When I issue the following commands, I see that a single row is create and
then updated, even if I was hoping to obtain two different rows:

    INSERT OR REPLACE INTO "players"
(id,skill,e,f,s,r,a,g,p,w,c,stagione,settimana,v) VALUES
("100","187","1","1","1","1","50","0","1","1","1","20","1","2011-09-05");

    INSERT OR REPLACE INTO "players"
(id,skill,e,f,s,r,a,g,p,w,c,stagione,settimana,v) VALUES
("100","187","1","1","1","1","50","0","1","1","1","20","2","2011-09-05");

The two INSERT rows are identical except the value under "settimana". I
expected to not have a conflict, so that an INSERT should be performed for
both the commands, but at the end I have only one row with settimana=2.

Do you know why?

Thanks in advance,

Livio
-- 
View this message in context: 
http://old.nabble.com/Multi-column-unique-constraint-in-SQLite-tp32441748p32441748.html
Sent from the SQLite mailing list archive at Nabble.com.

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to