2012/4/19 Chris Angelico <rosuav@xxxxxxxxx>
May be it was an artefact because i was using the same database from command line and thru php ?
because, right now, i do only :
INSERT ... RETURNING rowid;
and it works well from php...
i did quit the command line by "\q" in between...
If all your inserts make use of the sequence, and you never alter the
sequence, then this should never happen (unless, that is, 34 other
inserts happened between when you inserted and when you checked the
max). Be extremely careful of selecting max(rowid) when you have
concurrent transactions; it's entirely possible that some other
transaction has consumed a value from the sequence but hasn't yet
written it to the database (at least, not in any way that your
transaction can see), which means you risk resetting the sequence too
low.
ChrisA
May be it was an artefact because i was using the same database from command line and thru php ?
because, right now, i do only :
INSERT ... RETURNING rowid;
and it works well from php...
i did quit the command line by "\q" in between...
--
Yvon