Re: [PATCH][DOC] Fix for PREPARE TRANSACTION doc and postgres_fdw message.

From: Gilles Darold <gilles(at)darold(dot)net>
To: Etsuro Fujita <etsuro(dot)fujita(at)gmail(dot)com>
Cc: "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [PATCH][DOC] Fix for PREPARE TRANSACTION doc and postgres_fdw message.
Date: 2019-11-05 11:41:41
Message-ID: 5678ccd7-9ea9-00f5-d5fb-04fb8224794d@darold.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Esturo,

Le 05/11/2019 à 10:35, Etsuro Fujita a écrit :
> Hi Gilles,
>
> On Sat, Nov 2, 2019 at 1:29 AM Gilles Darold <gilles(at)darold(dot)net> wrote:
>> As per the following code, t1 is a remote table through postgres_fdw:
>> test=# BEGIN;
>> BEGIN
>> test=# SELECT * FROM t1;
>> ...
>>
>> test=# PREPARE TRANSACTION 'gxid1';
>> ERROR: cannot prepare a transaction that modified remote tables
>> I have attached a patch to the documentation that adds remote tables to the list of objects where any operation prevent using a prepared transaction, currently it is just notified "operations involving temporary tables or the session's temporary namespace".
> I'm not sure that's a good idea because file_fdw works well for
> PREPARE TRANSACTION! How about adding a note about that to the
> section of Transaction Management in the postgres_fdw documentation
> like the attached?

You are right, read only FDW can be used. A second point in favor of
your remark is that this is the responsibility of the FDW implementation
to throw an error when used with a prepared transaction and I see that
this is not the case for all FDW.

I have attached a single patch that include Etsuro Fujita's patch on
postgres_fdw documentation and mine on postgres_fdw error message with
the precision that it comes from postgres_fdw. The modification about
prepared transaction in PostgreSQL documentation has been removed.

--
Gilles Darold

Attachment Content-Type Size
fix_postgres_fdw_prepared_transaction-v3.diff text/x-patch 1.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Yuya Watari 2019-11-05 11:43:38 Re: Keep compiler silence (clang 10, implicit conversion from 'long' to 'double' )
Previous Message Ashutosh Sharma 2019-11-05 11:18:12 Re: tableam vs. TOAST