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 1uLvT3-0034oR-5Y for pgsql-hackers@arkaria.postgresql.org; Mon, 02 Jun 2025 03:04:05 +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 1uLvT0-006Zfd-60 for pgsql-hackers@arkaria.postgresql.org; Mon, 02 Jun 2025 03:04:02 +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 1uLvSz-006ZfV-SV for pgsql-hackers@lists.postgresql.org; Mon, 02 Jun 2025 03:04:01 +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 1uLvSu-0017hJ-38 for pgsql-hackers@lists.postgresql.org; Mon, 02 Jun 2025 03:03:59 +0000 Received: from [172.20.10.2] (sp49-97-71-74.msc.spmode.ne.jp [49.97.71.74]) by oss.nttdata.com (Postfix) with ESMTPSA id D76A7605FD; Mon, 2 Jun 2025 12:03:51 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at oss.nttdata.com Message-ID: Date: Mon, 2 Jun 2025 12:03:50 +0900 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: pgsql: postgres_fdw: Inherit the local transaction's access/deferrable To: Etsuro Fujita , pgsql-hackers@lists.postgresql.org References: Content-Language: en-US From: Fujii Masao In-Reply-To: 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/06/01 17:34, Etsuro Fujita wrote: > postgres_fdw: Inherit the local transaction's access/deferrable modes. > > Previously, postgres_fdw always 1) opened a remote transaction in READ > WRITE mode even when the local transaction was READ ONLY, causing a READ > ONLY transaction using it that references a foreign table mapped to a > remote view executing a volatile function to write in the remote side, > and 2) opened the remote transaction in NOT DEFERRABLE mode even when > the local transaction was DEFERRABLE, causing a SERIALIZABLE READ ONLY > DEFERRABLE transaction using it to abort due to a serialization failure > in the remote side. > > To avoid these, modify postgres_fdw to open a remote transaction in the > same access/deferrable modes as the local transaction. This commit also > modifies it to open a remote subtransaction in the same access mode as > the local subtransaction. > > Although these issues exist since the introduction of postgres_fdw, > there have been no reports from the field. So it seems fine to just fix > them in master only. I'm not sure this change should be considered a bug fix, since the current behavior of postgres_fdw with a local read-only transaction isn't clearly documented. Some users might see this as a behavioral change rather than a fix. Anyway if we go with it, shouldn't we document the change in the v18 release notes? Regards, -- Fujii Masao NTT DATA Japan Corporation