MemoryAny session (SET)default 8 MB

temp_buffers

Sets the maximum number of temporary buffers used by each session.

How you change it

Any session (SET)

Defaults and ranges on this page were read from pg_settings on live PostgreSQL 18.4. Treat older majors as needing their own check before you copy a value.

What this means

The per-session memory used to cache temporary table data. It can only be changed before the first use of a temporary table in a session. Sessions that never touch temp tables pay nothing.

When it matters

Raise for sessions that build and scan large temporary tables, such as ETL or reporting jobs.

Default8 MB
Range100 – 1073741823
Typeinteger
Change scopeAny session (SET)
CategoryMemory
Check the current value
SHOW temp_buffers;

Tradeoffs

  • Too low: temp-table pages churn through the small buffer and hit disk.
  • Allocated lazily up to the limit, but each session that uses temp tables can hold its own copy -- watch total sessions.
  • Must be set at session start to take effect.
PostgreSQL manual: temp_buffers

← All GUCs · Glossary · Runbooks