I suppose this is obvious, but it's volatile because *other* backends can change it while the current transaction is still in progress?
No. Other backends don't affect currval, but your own might on a row-by-row basis. Consider:
regression=# create sequence seq; CREATE SEQUENCE
regression=# select nextval('seq'), currval('seq'), s from generate_series(1,4) as t(s);
nextval | currval | s
---------+---------+---
1 | 1 | 1
2 | 2 | 2
3 | 3 | 3
4 | 4 | 4
(4 rows)
Joe
---------------------------(end of broadcast)--------------------------- TIP 6: Have you searched our list archives?
http://archives.postgresql.org