Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wppnj-001sHq-0f for pgsql-hackers@arkaria.postgresql.org; Fri, 31 Jul 2026 16:09:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wppnh-00GqQB-3B for pgsql-hackers@arkaria.postgresql.org; Fri, 31 Jul 2026 16:09:33 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wppnh-00GqQ3-1l for pgsql-hackers@lists.postgresql.org; Fri, 31 Jul 2026 16:09:33 +0000 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wppnf-00000001Jdp-18C7 for pgsql-hackers@postgresql.org; Fri, 31 Jul 2026 16:09:33 +0000 Received: by mail-pj1-x1034.google.com with SMTP id 98e67ed59e1d1-38e88b60121so977213a91.3 for ; Fri, 31 Jul 2026 09:09:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20251104.gappssmtp.com; s=20251104; t=1785514169; x=1786118969; darn=postgresql.org; h=mime-version:user-agent:content-transfer-encoding:content-type :references:in-reply-to:date:cc:to:from:subject:message-id:from:to :cc:subject:date:message-id:reply-to:content-type; bh=dT9VA6LRLPxvKbCqLVobeSkaCtkRIWM/S8yDAGNp7rE=; b=pM9Dzi+ivSEv54cUPX9yR8Be1c7iwWLEbT2o0EqSMGdehiN9u0Cyw9a241vrFdYwgS Y3JLF2h/ZrVQuMJmjLkfYSIaAMqNcMsAWPG7CubNPBjCoW8qOq2K2VPYvYGa1Ca6Bib7 m2X0ELfeTrkCGsFkqrv2tqGAT8Qb341anzhGAgXJo/qvB5s35PU89i5LknBmlSEHKWbP VIWmygL9KcZpSNGrVRqkpaeuks6JGFWm8LpI5k+b7HIKpqQNPWSgWWBOzgF397RXDH06 MWffCdcN9T8OO/CaoKACmTlAR/Jjxh97yk40+Gyp5142OthrA3PWsssqzqgjUmEX1EXc dMRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785514169; x=1786118969; h=mime-version:user-agent:content-transfer-encoding:content-type :references:in-reply-to:date:cc:to:from:subject:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=dT9VA6LRLPxvKbCqLVobeSkaCtkRIWM/S8yDAGNp7rE=; b=bV++14bMytExSSyOh2dIQlFwhDEyuPKLtAqP162D+H95GNBp0O6dA4uD6wLcGbOPGe yZyL/wdUjM+RVA5M7M+5vPTTdGtCF9kOz6Q2iwc3eouKj6COj6tk7ujQiQwm8pnks6gF AV9Qq+NyR7MUS/XxYq5nScjZw+ayKhYjDyGx0/kn2equcUSxmR9cE5K/ZQDTFdQBe6eV f+IzF7tCimP+TyYwTy2mS/hEHEcH5clXLTSxAyHJoU0YUQZLam8ohXlGnRB8H/Asj+Za nybPToRzI3njLTD6NrIHl1USrm6xBBHfGmU4vW1FDlqSmUFLkYphKG+zi2H4PGXQHy8f wPnQ== X-Forwarded-Encrypted: i=1; AHgh+RorSsnkb0jC94upSG0oh3iYomjNyl0unMu/BPGJToKfnMb8dsNZxH/kZgKUHrUyU+VBju56ToC9lTVqPNXt@postgresql.org X-Gm-Message-State: AOJu0YxRQQBApasgkb+p0lPT1SxQagglSbsW+0WjXjOXBmfNm5VVG2F4 89RAwmPhESvqtTYMLUT1YdTYayk0TSty9Tbgq7CXGBbEtJXnmdBHTJhcNBgToiid6jyiskU5qit XNkQ= X-Gm-Gg: AR+sD13/iLO11T2oOaPbwqE+Gukg0VSFdYvO2I3MJxcJehu2XG3a8loVTmdo5lqJ0Ws leZv9UT6O4mCRTyRA9lUdh5UDHLL9kbV0SyeN2e0PnhcStmqUI/pBRE6Cc5ljZJ+gbjuOoB9g0e jphqGAn25acaKXWe74EIZGexPWRd70XKpKLSkG3bV5tzwREG+/uKYWycPyfxc0cAZnTLm7iIf6y xEfCH9gK+uRUW8SeKVbibzNig6iYSftOm33bLWiEZoYd59wp6ripEtgmJuDTJpjoDtZNWk8vh2K 9Y2vY8EzbFtQPYL+LeUsVuwqmyLooKO0wRNet3tmsUAeIf6/QsAqtZ03qD58xZAVgDFTS7bzKqv RYUEg59w5cMXjuFijxi33sP46aBQeo8u5/18GksUN8Q+DH2s83YcExXpezYX6TZ9Dj1cmprYHJO t+ENlEGz6TFmMs4duTzQpl9oEwxtDSB50X8GX9TT6eqW2T/KofXdL7w/tCga0LulnD+SG3Fj21y yvH55/rm/O4qf1mwb3eYw== X-Received: by 2002:a17:90b:2dca:b0:38c:e9e9:e7ce with SMTP id 98e67ed59e1d1-38fbc408ae2mr451411a91.3.1785514168808; Fri, 31 Jul 2026 09:09:28 -0700 (PDT) Received: from jeff-ws-bridge.lan (c-24-7-19-3.hsd1.ca.comcast.net. [24.7.19.3]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-13fab132cc4sm4582458c88.2.2026.07.31.09.09.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Jul 2026 09:09:28 -0700 (PDT) Message-ID: <53a9cddd6a2b5eca78e65979890fa77d690d1279.camel@j-davis.com> Subject: Re: CREATE SUBSCRIPTION ... SERVER vs. pg_dump, etc. From: Jeff Davis To: Amit Kapila Cc: Noah Misch , pgsql-hackers@postgresql.org, "Hayato Kuroda (Fujitsu)" , Shlok Kyal , Fujii Masao , yuanchao zhang <145zhangyc@gmail.com> Date: Fri, 31 Jul 2026 09:09:27 -0700 In-Reply-To: References: <20260710195902.4f.noahmisch@microsoft.com> <35e50b0f80c850e5b9eb1dedcc0844852a2d2de0.camel@j-davis.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.3-0ubuntu1.1 MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, 2026-07-31 at 14:12 +0530, Amit Kapila wrote: > However, I feel it is better to detect the same > at DDL time whenever possible as well as it gives immediate, > synchronous feedback for interactive CREATE/ALTER, whereas a > worker-only failure just lands in the server log and the worker keeps > restarting. Removing it would also mean enabling retain_dead_tuples > no > longer validates the publisher at all in the common interactive case. I believe the only problem case is ALTER SUBSCRIPTION ... ENABLE, right? CREATE doesn't do the check when connect=3Dfalse, so that's the same behavior. None of ALTER ... SERVER, ALTER ... CONNECTION, or ALTER ... SET (retain_dead_tuples) are called by restore because it sets those things with the CREATE statement. If you'd still like ALTER SUBSCRIPTION ... ENABLE to do the convenience check, then I think you could clarify the problem case in the comments: + /* + * During binary upgrade, we only recreate the catalog state and must not + * connect to the publisher. The publisher's suitability for + * retain_dead_tuples is validated authoritatively by the apply worker + * when it connects, so skip the opportunistic DDL-time check here. + */ + if (IsBinaryUpgrade) + check_pub_rdt =3D false; During any restore we must not connect to the publisher. It's only a problem for binary upgrade because that's what issues the ENABLE. But the overall logic is more like "restore must not create any connections, therefore it must not issue any commands that set check_pub_rdt". We can't detect an ordinary restore (because it's treated the same as interactive SQL), so we just have to be sure not to introduce check_pub_rdt cases in the ordinary restore path later. Also, we need to integrate it with the series I posted because we must not generate the conninfo if IsBinaryUpgrade. I expect yours will go in first and I can rebase on that, so you don't need to make a change here. Regards, Jeff Davis