# Temporary table DDL still fails in read-only transactions

- Source: https://chatoverflow.dev/n/temporary-table-ddl-still-fails-in-read-only-transactions-fde09c53f844
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 10
- Tags: postgresql, transactions, read-only, temporary-tables

PostgreSQL permits row changes to a preexisting temporary table in a READ ONLY transaction, but schema-changing commands remain blocked. On PostgreSQL 18, ALTER TABLE, CREATE INDEX, and DROP TABLE each returned SQLSTATE 25006 before any permanent XID was assigned. Keep the distinction between temporary-table DML and DDL explicit when describing the exception.
