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

From: Gilles Darold <gilles(at)darold(dot)net>
To: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, etsuro(dot)fujita(at)gmail(dot)com
Cc: michael(at)paquier(dot)xyz, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: [PATCH][DOC] Fix for PREPARE TRANSACTION doc and postgres_fdw message.
Date: 2019-11-07 08:05:55
Message-ID: 00ce19da-2f7e-0232-65d5-120c99b2f179@darold.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Kyotaro,

Le 07/11/2019 à 08:10, Kyotaro Horiguchi a écrit :
> Hello.
>
> At Wed, 6 Nov 2019 20:13:10 +0900, Etsuro Fujita <etsuro(dot)fujita(at)gmail(dot)com> wrote in
>> Hi Michael-san,
>>
>> On Wed, Nov 6, 2019 at 4:35 PM Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>>> On Wed, Nov 06, 2019 at 03:12:04PM +0900, Etsuro Fujita wrote:
>>>> On Wed, Nov 6, 2019 at 1:13 PM Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>>>>> "postgres_fdw foreign tables" sounds weird to me. Could "foreign
>>>>> tables using postgres_fdw" be a better wording? I am wondering as
>>>>> well if we should not split this information into two parts: one for
>>>>> the actual error message which only mentions foreign tables, and a
>>>>> second one with a hint to mention that postgres_fdw has been used.
>>>> We use "postgres_fdw foreign tables" or "postgres_fdw tables" in
>>>> release notes, so I thought it was OK to use that in error messages as
>>>> well. But actually, these wordings are not suitable for error
>>>> messages?
>>> It is true that the docs of postgres_fdw use that and that it is used
>>> in some comments. Still, I found this wording a bit weird.. If you
>>> think that what you have is better, I am also fine to let you have the
>>> final word, so please feel to ignore me :)
>> I'd like to hear the opinions of others.
> FWIW, I see it a bit weird, too. And perhaps "prepare" should be in
> upper case letters. Plus, any operation including a SELECT on a
> temporary table inhibits PREAPRE TRANSACTION, but the same on a
> postgres_fdw foreign tables is not. So the error message is rather
> wrong.

This is not what I've experienced, see the first message of the thread.
A SELECT on foreign table prevent to use PREPARE TRANSACTION like with
temporary table. Perhaps postgres_fdw should not throw an error with
readonly queries on foreign tables but I guess that it is pretty hard to
know especially on a later PREPARE event. But maybe I'm wrong, it is not
easy every day :-) Can you share the SQL code you have executed to allow
PREPARE transaction after a SELECT on a postgres_fdw foreign table?

--
Gilles Darold

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2019-11-07 08:11:41 Re: Do we have a CF manager for November?
Previous Message btkimurayuzk 2019-11-07 08:04:51 Re: Add SQL function to show total block numbers in the relation