Re: Redundant errdetail prefix "The error was:" in some logical replication messages

From: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Smith <smithpb2250(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Redundant errdetail prefix "The error was:" in some logical replication messages
Date: 2021-03-30 06:21:01
Message-ID: CALj2ACURrfL4c-jMV29FvfMMgZU-HzUyZHw0OCmbYz3UeraAcg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Mar 30, 2021 at 11:40 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Peter Smith <smithpb2250(at)gmail(dot)com> writes:
> > There are a couple of error messages within the logical replication
> > code where the errdetail text includes a prefix of "The error was:"
>
> Hmm, isn't project style more usually to include the error reason
> in the primary message? That is,
>
> ereport(LOG,
> - (errmsg("could not drop the replication slot \"%s\" on publisher",
> - slotname),
> - errdetail("The error was: %s", res->err)));
> + (errmsg("could not drop the replication slot \"%s\" on publisher: %s",
> + slotname, res->err)));
>
> and so on. If we had reason to think that res->err would be extremely
> long, maybe pushing it to errdetail would be sensible, but I'm not
> seeing that that is likely.
>
> (I think the "the" before "replication slot" could go away, too.)

+1 to have the res->err in the primary message itself and get rid of
errdetail. Currently the error "could not fetch table info for table"
does that.

With Regards,
Bharath Rupireddy.
EnterpriseDB: http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2021-03-30 06:29:33 Re: TRUNCATE on foreign table
Previous Message Tom Lane 2021-03-30 06:10:34 Re: Redundant errdetail prefix "The error was:" in some logical replication messages