Re: Shouldn't postgres_fdw report warning when it gives up getting result from foreign server?

From: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Shouldn't postgres_fdw report warning when it gives up getting result from foreign server?
Date: 2021-11-22 05:16:36
Message-ID: CALj2ACUktE__O1a9J7E+dyGCDk=2RBKB3-fOArKipPJwcwmLjw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Nov 22, 2021 at 8:25 AM Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com> wrote:
>
> On 2021/11/20 1:38, Bharath Rupireddy wrote:
> > It reports "remote SQL command: (cancel request)" which isn't a sql
> > query, but it looks okay to me as we report (cancel request). The
> > pgfdw_get_cleanup_result_v1 patch LGTM.
>
> BTW, we can hide the message "remote SQL command: .." in cancel request case,
> but which would make the debug and troubleshooting harder.

Yeah, let's not hide the message.

> So I decided to
> use the string "(cancel request)" as SQL command string. Probably what string
> should be used as SQL command might be debatable.

For a cancel request maybe we can just say without te errcontext:
ereport(WARNING,
(errmsg("could not get result of cancel
request due to timeout")));

See the below existing message using "cancel request":
errmsg("could not send cancel request: %s",

For SQL command we can say:
ereport(WARNING,
(errmsg("could not get query result due to
timeout"),
query ? errcontext("remote SQL command:
%s", query) : 0));

Regards,
Bharath Rupireddy.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeevan Ladhe 2021-11-22 05:45:55 Re: Teach pg_receivewal to use lz4 compression
Previous Message Bharath Rupireddy 2021-11-22 04:59:33 Re: issue in pgfdw_report_error()?