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.94.2) (envelope-from ) id 1uIHQX-001Wm8-ML for pgsql-docs@arkaria.postgresql.org; Fri, 23 May 2025 01:42:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uIHQW-00C7FM-Hm for pgsql-docs@arkaria.postgresql.org; Fri, 23 May 2025 01:42:24 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uIHQW-00C7FE-AH for pgsql-docs@lists.postgresql.org; Fri, 23 May 2025 01:42:24 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by makus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uIHQS-000PKD-1p for pgsql-docs@lists.postgresql.org; Fri, 23 May 2025 01:42:23 +0000 Received: from [192.168.11.2] (p1696134-ipoe.ipoe.ocn.ne.jp [118.0.93.133]) by oss.nttdata.com (Postfix) with ESMTPSA id 17876606AA; Fri, 23 May 2025 10:42:14 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at oss.nttdata.com Message-ID: <97694620-3bfe-457c-8761-1a08a233f57b@oss.nttdata.com> Date: Fri, 23 May 2025 10:42:13 +0900 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Hot standbys now support exporting snapshots while creating a logical replication slot To: kevinkbiju@gmail.com, pgsql-docs@lists.postgresql.org References: <174791480466.798.17122832105389395178@wrigleys.postgresql.org> Content-Language: en-US From: Fujii Masao In-Reply-To: <174791480466.798.17122832105389395178@wrigleys.postgresql.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2025/05/22 20:53, PG Doc comments form wrote: > The following documentation comment has been logged on the website: > > Page: https://www.postgresql.org/docs/17/logicaldecoding-explanation.html > Description: > > Hi, > I'm referring to this bit at the very end of the page: Creation of a > snapshot is not always possible. In particular, it will fail when connected > to a hot standby. Applications that do not require snapshot export may > suppress it with the NOEXPORT_SNAPSHOT option. > It's not clear what the intention of this is (is it referring only to > physical replication slots?) but as it stands you can export snapshots while > creating a logical replication slot. This should have been possible starting > PG16, I've tested this on PG17. The description "Creation of a snapshot is not always possible. In particular, it will fail when connected to a hot standby." no longer seems accurate. Since v10 (commit 6c2003f8a1b), exporting snapshots on a standby has been supported. This description was accurate when the first patch [1] adding that description was written, but I think we just overlooked updating it later. > As an aside, I think NOEXPORT_SNAPSHOT is from the older syntax of > CREATE_REPLICATION_SLOT and should be swapped with SNAPSHOT 'nothing'. Yes, so how about the following change? - Creation of a snapshot is not always possible. In particular, it will - fail when connected to a hot standby. Applications that do not require - snapshot export may suppress it with the NOEXPORT_SNAPSHOT + Applications that do not require + snapshot export may suppress it with the SNAPSHOT 'nothing' option. Regards, [1] https://www.postgresql.org/message-id/CAMsr+YFjxv0T8Yi1Q=3tVdgViU2bm+fb_-XUbTfxHsnLDNSkzg@mail.gmail.com Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION