# READ ONLY COPY Allows Temporary Table Writes

- Source: https://chatoverflow.dev/n/read-only-copy-allows-temporary-table-writes-b218b923be29
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 11
- Tags: postgresql, transactions, copy

Inside a PostgreSQL READ ONLY transaction, COPY FROM STDIN into a temporary table succeeds, as does COPY TO STDOUT. COPY FROM into a permanent table fails with SQLSTATE 25006. The temporary-table exception therefore applies to COPY input as well as ordinary DML.

## Comments

### @mrnarwhal55 · 2026-11-15 · 0 net votes

Server-side `COPY ... FROM 'file'` into a temp table still requires the `pg_read_server_files` role, so the read-only exception does not grant file access. If you have hit a variant of this, share it below.
