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 1txmIn-00EXPS-Nn for pgsql-hackers@arkaria.postgresql.org; Thu, 27 Mar 2025 12:25:41 +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 1txmIl-005P95-13 for pgsql-hackers@arkaria.postgresql.org; Thu, 27 Mar 2025 12:25:39 +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 1txmIk-005P8x-Nq for pgsql-hackers@lists.postgresql.org; Thu, 27 Mar 2025 12:25:38 +0000 Received: from mail-vk1-xa32.google.com ([2607:f8b0:4864:20::a32]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1txmIi-001QY7-2x for pgsql-hackers@lists.postgresql.org; Thu, 27 Mar 2025 12:25:37 +0000 Received: by mail-vk1-xa32.google.com with SMTP id 71dfb90a1353d-52403e39a23so869173e0c.2 for ; Thu, 27 Mar 2025 05:25:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743078336; x=1743683136; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=/Sswfh3KvvLBhTTg/YHQhUVyafeFp1fCoMOHMaoGxHE=; b=YYhlOd0qTlL54kxsE1p2CqQuE5jCqEkor0YOntNtOzCVhf00r/kodZDX0ifYLbx+Oj 1NV0jvfOo/uNqhdqW0wUflrPXKIxRuFdJppLff7cqBS14q5h/AuIjU60MgnqMAj3E/ka d26t6h4Y7KJZyFW1ipHUNSXkroSmskV2Qv6GdFqBbvasCU2WvwfudCQxJ++oZn6TgJf/ rcVCA9Z0RzeWZJWYw6f5K7TZDWMfxv9f1VhIMxcNuq9scAEdDYgNEpbvpDzqOsf4bSru d4c+XUOHgkQQHODN42yoIiCL67/TL0ic0TdLMtLp0zLIi+J+4tb/jyquv+R6at7F7urt /mlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743078336; x=1743683136; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/Sswfh3KvvLBhTTg/YHQhUVyafeFp1fCoMOHMaoGxHE=; b=U4XS8ZS2agosLIygSLhZ+8vq1EH81TgLIgQaOM6XL27bFPN3oyl5EG3JPVQJhe0b7s 69W1+zw7QSvGMa0YAZ/jECMpuOATKKjVFDAz+rv7siswsdbmiPhq+xRGx5qtmbmZENLX qvbhy+0pdxDJtB32ayHJvTN6T6C/cl1XHWEOSvI3XT0hsmG6EiLJn8DnIKr4bzDLJ9el Ig/D+bhlUryS0vq6hFA/kpWrUp+EtL1xUmQZEbBrdRvKUYRD2x0e7/zUyeodnKM0inaM hNBlE3VLyUxjFZ9QGywdX/uWeAY7Y6NmnjNkljg8ySJdslgh2j1EMBfp5cewQnwkOFAo SEzA== X-Forwarded-Encrypted: i=1; AJvYcCVqBoQG4RMYuosCmEH2d5l/x56rmArV0iUdQlQu8Sc0XOtMltYDIYmSmtll/RCJuIQg2FyZLJwmMEoVIHgE@lists.postgresql.org X-Gm-Message-State: AOJu0Yx+txTp9EXb9mtIsP5RJMiFnOF2LGFwPUhRdGl7crM1LWViJTuE 0ZdBl9Vc4MnI6px4derMKjj3q53zHcokCDe+nWyW1YLd3QO8ocfBvfDJGXGaiHmvfpjIiJbu/1Y gFlhW77zBWR+GIP7//OVK12TiaE0= X-Gm-Gg: ASbGncs/ENs7EEhVxp7gawP3vvKxEjHhPztXV2vlvL6T8VHCCwp2LWlf6tR19j4tP9H kFqkv9TlTX3+ct7XgetnTqVG9vtybqZFeDGzP3li44RFcRZu9n1/OBPwCHI2ZxsZSgxJadWgsFI u7JFZbDjpzfDREviRh5Z1QBCP89k4qtr2s+BU+xg== X-Google-Smtp-Source: AGHT+IE2FcwFWtC9zUXmtvcrqFqmAMne/0sl0VUl/l13QT7vmaRWHovX2kTOXxP1hUHg7kMBKNy5e1ZQC3rDbZsZlxo= X-Received: by 2002:a05:6102:3585:b0:4c1:b2c2:61a with SMTP id ada2fe7eead31-4c5870a7941mr3050170137.25.1743078335775; Thu, 27 Mar 2025 05:25:35 -0700 (PDT) MIME-Version: 1.0 References: <3660951.1741016970@sss.pgh.pa.us> In-Reply-To: From: Ashutosh Bapat Date: Thu, 27 Mar 2025 17:55:24 +0530 X-Gm-Features: AQ5f1Jo1GOT3ePXQCGNfp0T4sn0gXBWDogHNV_NRA0qkUJuOaknaQPZy5tFPFJc Message-ID: Subject: =?UTF-8?Q?Re=3A_Options_to_control_remote_transactions=E2=80=99_access?= =?UTF-8?Q?=2Fdeferrable_modes_in_postgres=5Ffdw?= To: Etsuro Fujita Cc: Tom Lane , PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Mar 25, 2025 at 4:01=E2=80=AFPM Etsuro Fujita wrote: > > In the patch I also fixed a bug; I trusted XactReadOnly to see if the > local transaction is READ ONLY, but I noticed that that is not 100% > correct, because a transaction which started as READ WRITE can show as > READ ONLY later within subtransactions, so I modified the patch so > that postgres_fdw opens remote transactions in READ ONLY mode if the > local transaction has been declared READ ONLY at the top level. Nice catch. postgres_fdw replicates the transaction stack on foreign server. I think we need to replicate it along with the transaction properties. And also we need a test which tests readonly subtransaction behaviour. --=20 Best Wishes, Ashutosh Bapat