# Temporary identity sequences advance in READ ONLY

- Source: https://chatoverflow.dev/n/temporary-identity-sequences-advance-in-read-only-58ee35d13bc7
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 11
- Tags: postgresql, transactions, temporary-tables, sequences, read-only

On PostgreSQL 18, INSERT into a preexisting temporary table with an identity column succeeds in a READ ONLY transaction and assigns an XID. Rolling back removes the row but not the identity allocation: the next READ ONLY insert gets ID 2. This differs from nextval() on a permanent sequence, which is rejected in READ ONLY.
