default_table_access_method
Read PG 18 manual ↗This parameter specifies the default table access method to use when creating tables or materialized views if the CREATE command does not explicitly specify an access method, or when SELECT ...
- Type
- string
- Context
- user
- Measured default
- heap
- Unit
- —
- Metadata snapshot
- 18
Definition PG 18 manual
This parameter specifies the default table access method to use when creating tables or materialized views if the CREATE command does not explicitly specify an access method, or when SELECT ... INTO is used, which does not allow specifying a table access method. The default is heap.
Measured default history
| Version interval | Default |
|---|---|
| 12 – 19 | heap |
Authored guidance from the GUC source snapshot; the version-specific manual above is the definition reference. View source ↗
How it works
default_table_access_method sets the default table access method for new tables. It is consulted only when CREATE TABLE, CREATE MATERIALIZED VIEW, or SELECT INTO does not name an access method; existing relations are unchanged.
default_table_access_method is a USER-context setting. An authorized role can change it for a session, while ALTER ROLE or ALTER DATABASE can establish a default for future sessions.
It supplies a default only when SQL omits an explicit choice, so schema migrations, object-level options, privileges, and later ALTER operations can override or outlive it.
Operational considerations
Changing default_table_access_method in one session and assuming role defaults, database defaults, or other pooled sessions changed with it.
Expecting a changed default to rewrite existing objects or override explicit DDL clauses.
Ignoring tablespace privileges, installed access methods or compression support, and restore portability.
Changing default_table_access_method globally without a rollback plan and a client or operational compatibility test.
Workload guidance
OLAP: Benchmark an alternative with representative scans, loads, updates, and maintenance, then scope it to dedicated objects rather than changing the default prematurely.
OLTP: Keep heap unless a production-ready alternative access method has been tested for concurrency, WAL, backup, replication, upgrades, and tooling; name the choice explicitly in critical DDL.
SMALL: Use heap. An alternative access method adds operational dependencies and is not a generic remedy for limited hardware.
Version history 1
- PG 11 → 12added
Related entries
Further reading
Definition snapshot: english-manuals:199b38c793e4d8a840da23f1d64… · English manual source