Pyh.conf’25: a new PHP conference for the Russian-speaking community

Voting

: nine minus five?
(Example: nine)

The Note You're Voting On

julian at e2-media dot co dot nz
21 years ago
The way I nuderstand it, each value is emitted by a sequence only ONCE. If you retrieve a number (say 12) from a sequence using nextval(), the sequence will advance and subsequent calls to nextval() will return further numbers (after 12) in the sequence.

This means that if you use nextval() to retrieve a value to use as a primary key, you can be guaranteed that no other calls to nextval() on that sequence will return the same value. No race conditions, no transactions required.

That's what sequences are *for* afaik :^)

<< Back to user notes page

To Top