Re: [sqlite] Multi-column unique constraint in SQLite

2011-09-12 Thread liviodl
Simon Slavin-3 wrote: > > > I agree with Jay. What's happening is this: > > New row assembled. > Attempt to INSERT new row (first attempt) > INSERT fails UNIQUE contraint. > Notes that it was an INSERT OR REPLACE, therefore ... > DELETE original row. > Attempt to INSERT new row

Re: [sqlite] Multi-column unique constraint in SQLite

2011-09-11 Thread liviodl
Bernd Lehmkuhl wrote: > > I think that the 'OR REPLACE' clause refers to the primary key, which > hasn't necessarily to do with a unique index defined elsewhere. So if > you have a primary key set on id, that would be the result. > ___ >

[sqlite] Multi-column unique constraint in SQLite

2011-09-11 Thread liviodl
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