Re: Redundant errdetail prefix "The error was:" in some logical replication messages - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Redundant errdetail prefix "The error was:" in some logical replication messages
Date
Msg-id 2781563.1617084634@sss.pgh.pa.us
Whole thread Raw
In response to Redundant errdetail prefix "The error was:" in some logical replication messages  (Peter Smith <smithpb2250@gmail.com>)
Responses Re: Redundant errdetail prefix "The error was:" in some logical replication messages  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Re: Redundant errdetail prefix "The error was:" in some logical replication messages  (Peter Smith <smithpb2250@gmail.com>)
List pgsql-hackers
Peter Smith <smithpb2250@gmail.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.)

            regards, tom lane



pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: [Proposal] Global temporary tables
Next
From: Bharath Rupireddy
Date:
Subject: Re: Redundant errdetail prefix "The error was:" in some logical replication messages