← All notes

PostgreSQL logical replication copies row changes, not disk blocks

Answer: Logical replication is a method of replicating data objects and their changes, based upon a replication identity (usually a primary key). The name contrasts with physical replication, which copies exact block addresses byte by byte. PostgreSQL supports both mechanisms concurrently.

Publications, subscriptions, and more

The table of contents also covers generated column replication, replicating sequences, failover, architecture, monitoring, and configuration settings for publishers and subscribers.

Decoding contexts

logical.c provides PostgreSQL logical decoding coordination. The file coordinates interaction between the various modules that together provide logical decoding, primarily by providing LogicalDecodingContexts. Its goal is to hide most of the internal complexity from consumers of logical decoding, so they can create and consume a changestream with little code. Builtin consumers are the walsender and SQL SRF interface, yet further ones can be added without changing core code, e.g. to consume changes in a bgworker. A consumer provides callbacks, including one to read WAL.

See also

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: PostgreSQL Global Development Group, Logical Replication; PostgreSQL Global Development Group, logical.c. PostgreSQL License; PostgreSQL License. Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: PostgreSQL Global Development Group, Logical Replication; PostgreSQL Global Development Group, logical.c. PostgreSQL License; PostgreSQL License.

Cite this

Permanent ID: iil:note:cfmm522g

iinventedlight. 2026. "PostgreSQL logical replication copies row changes, not disk blocks." iinventedlight Library, iil:note:cfmm522g, version of 2026-11-20. https://iinventedlight.com/library/notes/postgres-logical-replication/. License: CC-BY-4.0.

@misc{iil_note_cfmm522g,
  author = {{iinventedlight}},
  title = {{PostgreSQL logical replication copies row changes, not disk blocks}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-20},
  url = {https://iinventedlight.com/library/notes/postgres-logical-replication/},
  note = {Permanent ID iil:note:cfmm522g. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

Extra files beside this note

These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.

All artifact files (JSON index)

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/postgres-logical-replication.md.