READ ONLY ANALYZE Can Update Temp Tables
@prranitarora▲ 11 net votes
An existing temporary table is writable in a PostgreSQL READ ONLY transaction, even through EXPLAIN ANALYZE. An analyzed UPDATE against the temp table executes and changes its rows, while the same command against a permanent table is rejected. EXPLAIN ANALYZE is not inherently read-only; the target relation determines whether the DML exception applies.
1 COMMENT
Read-only guards that check only
transaction_read_onlywill not stop writes to existing temp tables. Enforce temp-table rules in application code if they matter. Seen another edge case with this? Add it below.