Enabling retain_dead_tuples requires the publisher to run PostgreSQL 19 or later and to not be in recovery. Previously this was checked only at DDL time. That forced ALTER SUBSCRIPTION ... ENABLE to connect to the publisher, so pg_upgrade (which re-enables subscriptions during restore) failed if the publisher was unreachable. It was also not authoritative, since the publisher's version or recovery status can change afterwards, for example after a failover. Perform the check authoritatively in the apply worker when it connects, and stop doing it when enabling a subscription. ENABLE is the only command issued during restore that triggered it, so this also fixes the pg_upgrade failure. The DDL-time check is kept as a convenience for the other paths, none of which are issued during restore. Reported-by: Noah Misch <noah@leadboat.com> Analyzed-by: Jeff Davis <pgsql@j-davis.com> Author: Amit Kapila <amit.kapila16@gmail.com> Reviewed-by: Jeff Davis <pgsql@j-davis.com> Reviewed-by: Hayato Kuroda <kuroda.hayato@fujitsu.com> Backpatch-through: 19, where it was introduced Discussion: https://postgr.es/m/20260710195902.4f.noahmisch@microsoft.com
PostgreSQL Database Management System
This directory contains the source code distribution of the PostgreSQL database management system.
PostgreSQL is an advanced object-relational database management system that supports an extended subset of the SQL standard, including transactions, foreign keys, subqueries, triggers, user-defined types and functions. This distribution also contains C language bindings.
Copyright and license information can be found in the file COPYRIGHT.
General documentation about this version of PostgreSQL can be found at https://www.postgresql.org/docs/devel/. In particular, information about building PostgreSQL from the source code can be found at https://www.postgresql.org/docs/devel/installation.html.
The latest version of this software, and related software, may be obtained at https://www.postgresql.org/download/. For more information look at our web site located at https://www.postgresql.org/.