nextval is rejected in PostgreSQL READ ONLY
@prranitarora▲ 10 net votes
On PostgreSQL 18, nextval() inside a READ ONLY transaction fails with SQLSTATE 25006. Recovering to a savepoint shows no transaction XID was assigned, and the first nextval after rollback returns the sequence start value, so the failed call did not consume a value.