Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Yes—PostgreSQL logical replication can feed a reporting database, and PostgreSQL lists analytical consolidation as a use case. It is a good fit when reports need selected tables or data from a publisher, but it is not a turnkey copy of production: you must manage schema changes, initial data synchronization, row identity, apply conflicts, and retained WAL. A reporting subscriber is also not automatically ready to take over as a writable failover server.

This guide reflects the PostgreSQL 18 documentation available on October 7, 2026. The documentation identified PostgreSQL 18, 17, 16, 15, and 14 as supported at that time; check the documentation for your deployed major version and your provider’s restrictions before relying on a particular option.

Is logical replication the right kind of reporting replica?

Logical replication publishes table changes from a publisher to a subscriber. The subscriber first copies existing rows for the tables being synchronized, then applies subsequent changes in publisher order. That lets you create a separate database for reporting without necessarily copying the publisher’s entire cluster.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The main design choice is whether you want a selective, table-oriented data feed or a cluster-level standby. Logical replication can support selective datasets and subscriptions across major versions, but requires you to coordinate schemas and monitor logical slots. A physical standby replays WAL for a cluster-level copy and has its own recovery-conflict and WAL-retention tradeoffs.

Decision point Logical replication Physical standby
Data scope Selected published tables can feed the subscriber. Replays WAL for a cluster-level copy.
Schema and DDL DDL is not replicated; manage compatible schemas separately. Follows the cluster’s WAL stream rather than a separately managed table publication.
Reporting flexibility Subscriber can host reporting structures alongside replicated tables, subject to the design and apply constraints. Use is shaped by standby recovery behavior and the physical copy.
Operational risks Logical slot retention, initial table-copy load, and apply conflicts need attention. WAL retention and hot-standby recovery conflicts need attention; standby feedback has tradeoffs.
Failover readiness Not automatic: sequence state and other promotion requirements need separate planning. Designed around a cluster-level copy, but its recovery and WAL configuration still matter.

Choose logical replication when table-level selection or subscriber flexibility is worth the extra coordination. Choose a physical standby when the requirement is a cluster-level replica and its recovery behavior suits the reporting workload. Neither choice guarantees a particular reporting freshness; observe the actual pipeline and set an acceptable lag target for your workload.

What does logical replication not copy?

Schema changes need a coordinated deployment

PostgreSQL’s documentation is explicit: “The database schema and DDL commands are not replicated.” Subscriber tables must already exist and remain compatible with incoming changes. Tables are matched by fully qualified name and columns by name; their column order may differ. Some text-representable type differences are supported, while binary transfer is more restrictive. Extra subscriber columns receive their declared defaults. Views are not replication targets.

If a publisher-side change makes incoming rows incompatible with the subscriber table, apply can fail until the subscriber schema is updated. A common rollout pattern is to make a compatible additive change on the subscriber first, change the publisher, and remove obsolete structures only after the stream and reporting consumers no longer need them. Treat that as a migration strategy, not a guarantee: assess each change against the actual column types, constraints, and transfer mode.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Sequence state is separate from replicated rows

Replicated inserts carry serial or identity column values as table data, but they do not advance the subscriber’s underlying sequence. This is usually not a problem while the reporting database remains read-only. If it might become writable or be promoted, copy or advance sequence state as a separate failover task; otherwise a later insert can draw a value already present in the replicated table.

Derived reporting objects need their own plan

Only tables, including partitioned tables, can be replication targets. Views, materialized views, and foreign tables are not. Create view definitions and plan materialized-view refreshes or other derived-data builds separately on the subscriber or in a downstream analytics layer.

For partitioned tables, the default behavior publishes changes from publisher leaf partitions, so those changes must map to valid target tables on the subscriber. The version-dependent publish_via_partition_root option instead uses the root table’s identity and schema. Truncation also needs deliberate treatment: a replicated truncate can fail on the subscriber when foreign-key-connected tables are not all covered by the same subscription.

Will the initial copy obey publication filters?

Do not assume that an operation filter limits the initial baseline. During initial table synchronization, PostgreSQL copies existing rows even when the publication’s publish operation list excludes some operations. Row-filter behavior also needs separate checking during initialization; PostgreSQL’s architecture documentation describes an example where a second unfiltered publication for a table results in all rows being initially copied.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Plan the first synchronization as a data movement operation, not just the start of a change stream. The copy uses table-sync workers and temporary table-copy slots before handing each table to the main apply worker. Account for the publisher’s reads, subscriber writes, network transfer, and worker capacity. After synchronization, validate the subscriber’s contents against the intended reporting scope rather than inferring that the publication’s ongoing DML filters defined the baseline.

Do published tables have a usable row identity?

For published UPDATE and DELETE operations, PostgreSQL needs to identify the target row. The default is a primary key; an eligible unique index can also serve as identity. The subscriber needs an identity made up of the same or fewer columns when the publisher uses a non-FULL identity. Tables without an applicable identity cannot successfully apply published updates or deletes.

REPLICA IDENTITY FULL uses the whole row as identity, but can make subscriber-side row searches inefficient without a suitable index. It is a fallback to evaluate against the table’s data shape and update/delete volume, not a shortcut to apply indiscriminately.

  • Inventory published tables for primary keys, eligible unique indexes, or another stable identity before enabling updates and deletes.
  • Confirm the subscriber has the compatible identity required by the publisher’s choice.
  • For tables that lack a suitable key, decide whether to add one or assess the performance implications of FULL.

How can the subscriber fall behind or stop applying?

Separate the stages of lag

Use subscriber worker information together with subscription state and logs. On the subscriber, pg_stat_subscription shows replication workers. An enabled subscription ordinarily has an apply process; initial synchronization and parallel apply can add workers. A disabled or crashed subscription has no row, so the view alone is not a complete health check.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Compare WAL progress at the publisher and subscriber to locate where delay is accumulating. PostgreSQL’s physical streaming guidance describes useful stage comparisons: current WAL versus sent position can point to publisher load; sent versus received can point to network delay or subscriber load; and received or flushed versus replayed can point to replay falling behind. These are diagnostic clues from physical streaming, not a complete logical-replication lag recipe, so interpret them alongside logical worker state and logs.

Slot retention can become a disk problem

A publisher slot retains WAL needed by its consumer. If a subscriber becomes unreachable or is abandoned and its slot is left behind, retained WAL can grow until it threatens publisher disk space. PostgreSQL also warns that physical replication slots can retain enough WAL to fill pg_wal. Track slot retention and disk headroom, and review slots after a subscription teardown or host migration. Do not drop a slot until you understand which consumer depends on it and whether it is still needed for recovery.

Capacity is shared across replication work

Planning includes wal_level = logical, publisher slot and WAL sender capacity, and subscriber origin and logical-worker capacity, including room for table synchronization. Worker processes are shared with other PostgreSQL features and extensions, so sizing depends on the cluster rather than a universal setting.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What happens when apply hits a conflict?

Some constraint violations and permission problems stop apply and require manual resolution. A missing target row for certain replicated UPDATE or DELETE cases can be skipped rather than reported as an error, so a running worker is not proof that the subscriber is fully in parity with the publisher.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Apply runs with the subscription owner’s privileges. Check that owner’s grants on target tables and review row-level security: applicable row-level security on target tables can cause conflicts regardless of what a policy would normally permit. When apply stops, inspect subscriber logs and conflict statistics, then resolve the underlying data or permission issue before resuming.

Do not treat transaction skipping as routine repair. PostgreSQL provides ALTER SUBSCRIPTION ... SKIP and replication-origin advancement mechanisms, but skipping a transaction also skips its non-conflicting changes. That can leave the subscriber inconsistent. Use either only after understanding the whole transaction and planning how to reconcile the resulting data.

How should you keep reporting writes from disrupting replication?

Keep replicated tables read-only to the reporting application when possible. PostgreSQL notes that a subscriber treated as read-only by an application avoids conflicts from a single subscription. If local applications or other subscriptions write overlapping data, those writes can conflict with replicated changes.

Separate reporting transformations from replicated source tables where practical, and make the ownership and write rules clear. This reduces accidental collisions; it does not replace monitoring, schema coordination, or recovery planning.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What should you verify before and after cutover?

Before enabling the subscription

  • Confirm logical replication settings and available slots, senders, and workers on the deployed PostgreSQL version and hosting service.
  • Prepare subscriber tables and coordinate schema rollout independently from publisher DDL.
  • Review every published table’s row identity if updates or deletes are published.
  • Decide whether the initial copy includes the rows you intend to report on, including the effect of operation filters, row filters, and multiple publications.
  • Check subscription-owner permissions, target grants, and row-level security behavior.
  • Estimate the initial copy’s impact on publisher reads, subscriber writes, network, and worker capacity.
  • Define what the reporting subscriber is allowed to write and whether it could ever be promoted.

After synchronization

  • Verify table contents against the intended publication scope rather than relying only on worker status.
  • Monitor worker state, logs, conflict information, and WAL progress to locate lag.
  • Track slot retention and available disk space on the publisher.
  • Exercise schema changes and recovery procedures in a way that reflects your deployed version and provider setup.
  • If promotion is in scope, include sequence state and all other write-readiness requirements in the failover plan.

Is a reporting subscriber automatically failover-ready?

No. Logical replication provides a useful stream of table data, but it does not copy DDL or sequence progress, and conflicts or missed row changes can leave the subscriber different from the publisher. A reporting-only subscriber can be a sound analytical target while still being unsuitable for immediate promotion. Treat failover as a separate design: account for schema, sequence state, data reconciliation, and the process for making the subscriber writable.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.