I tried this. I created a sequence, and ran last_value, then nextval, repeatedly. last_value always returned 20 until nextval returned 21, then last_value returned 40 and kept returning 40 until nextval returned 41, etc.
Weird things can happen with sequences (well, they look weird sometimes - actually they're the behaviour people want in real world applications), due to caching and different sessions. What does "select * from <sequence>" show? And how were you running those queries, both in terms of pgAdmin vs. psql etc. and transaction control?
On Fri, May 14, 2021 at 9:39 AM Dave Page <dpage@pgadmin.org> wrote: