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 1uMfX8-000Roc-Fs for pgsql-hackers@arkaria.postgresql.org; Wed, 04 Jun 2025 04:15:22 +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 1uMfX5-007elr-F4 for pgsql-hackers@arkaria.postgresql.org; Wed, 04 Jun 2025 04:15:20 +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.94.2) (envelope-from ) id 1uMfX5-007efv-5T for pgsql-hackers@lists.postgresql.org; Wed, 04 Jun 2025 04:15:19 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by magus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uMfWz-00073b-28 for pgsql-hackers@lists.postgresql.org; Wed, 04 Jun 2025 04:15:15 +0000 Received: from [192.168.179.9] (mo27-229-180-242.air.mopera.net [27.229.180.242]) by oss.nttdata.com (Postfix) with ESMTPSA id 17EEA61BFB; Wed, 4 Jun 2025 13:14:53 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at oss.nttdata.com Message-ID: Date: Wed, 4 Jun 2025 13:14:44 +0900 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: pgsql: postgres_fdw: Inherit the local transaction's access/deferrable To: Etsuro Fujita , Michael Paquier Cc: 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: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2025/06/03 19:45, Etsuro Fujita wrote: > On Mon, Jun 2, 2025 at 12:33 PM Michael Paquier wrote: >> On Mon, Jun 02, 2025 at 12:03:50PM +0900, Fujii Masao wrote: >>> 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? >> >> After going through the thread and the commit, I have to admit that I >> was surprised to see this applied on HEAD now that we are in feature >> freeze. This is a behavior change. Perhaps this could be done once >> v19 happens, still it's rather unclear if the new behavior is better >> than the previous one. > > No, this is a fix, not a feature, as discussed in the thread; as > mentioned in the commit message, the previous version of postgres_fdw > could cause surprising behaviors that would never happen in normal > cases where a read-only and/or deferrable transaction only > accesses/modifies data on the local server, so this commit fixes those > behaviors. I agree this could be considered a fix if the new behavior has been clearly explained in the documentation from before or based on standards like SQL/MED. But if that's not the case, it seems more like a behavior change. In that case, I think it should wait for v19 and be applied only after reaching consensus. Some systems might rely on the previous behavior. By the way, if a read-only transaction on the local server is meant to block all write operations on the remote server, this patch alone might not be sufficient, for example, that read-only transaction can invoke a login trigger on the remote server and it could still perform writes. Regards, -- Fujii Masao NTT DATA Japan Corporation