| 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-12-03 14:04:21 | 
| Message-ID: | CALj2ACUPJ9+XLsx0ws9yQ0o=vRCM4Eq8UgUrXbCxV3aNQ3+ibw@mail.gmail.com | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-hackers | 
On Fri, Dec 3, 2021 at 2:26 PM Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com> wrote:
> > 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));
>
> I wonder how pgfdw_get_cleanup_result() can determine which
> log message to report. Probably we can add new boolean argument
> to pgfdw_get_cleanup_result() so that it should be set to true
> for cancel request case, but false for query case. Then
> pgfdw_get_cleanup_result() can decide wihch message to log
> based on that argument. But it seems not good design to me.
> Thought?
Let's not use the boolean just for the cancel request which isn't
scalable IMO. Maybe a macro/enum?
Otherwise, we could just do, although it doesn't look elegant:
if (pgfdw_get_cleanup_result(conn, endtime, &result, "(cancel request)"))
if (strcmp(query, "(cancel request)") == 0)
    WARNING without  "remote SQL command:
else
    WARNING with "remote SQL command:
Regards,
Bharath Rupireddy.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Ashutosh Sharma | 2021-12-03 14:08:45 | Re: [Proposal] Fully WAL logged CREATE DATABASE - No Checkpoints | 
| Previous Message | Andrei Zubkov | 2021-12-03 14:03:46 | Re: [PATCH] Tracking statements entry timestamp in pg_stat_statements |