IT lexicon › Database › Unlogged table

Unlogged table

Database På svenska → Updated: 2026-07-29

A PostgreSQL table whose changes are never written to the transaction log. Substantially faster to write to, and empty after the next crash.

Normally every change goes first to the WAL and then to the data files, which is what makes recovery possible and replication meaningful. Opt out and roughly half the write work disappears. The price is exactly what you would guess: after an unclean shutdown the table is automatically truncated at startup, since the server cannot know whether its contents are consistent, and it is never replicated to standbys either. That rules it out for anything not reconstructible — but makes it excellent for staging in import pipelines, materialised caches and session data. It can be converted afterwards with ALTER TABLE … SET LOGGED, which does write the whole table to the WAL in one go.

← Back to the lexicon