Re: Improve the connection failure error messages - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Improve the connection failure error messages
Date
Msg-id 2189315.1720719023@sss.pgh.pa.us
Whole thread Raw
In response to Re: Improve the connection failure error messages  (Nisha Moond <nisha.moond412@gmail.com>)
List pgsql-hackers
Nisha Moond <nisha.moond412@gmail.com> writes:
> Attached the patch v6 with suggested improvements.
> - Removed unnecessary translator comments.
> - Added appropriate identifier names where missing.

I think this is generally OK, although one could argue that it's
violating our message style guideline that primary error messages
should be short [1].  The text itself isn't that bad, but once you
tack on a libpq connection failure message it's hard to claim that
the result "fits on one line".

Another way we could address this that'd reduce that problem is to
leave the primary messages as-is and add an errdetail or errcontext
message to show what's throwing the error.  However, I'm not convinced
that's better.  The main argument against it is that detail/context
lines can get lost, eg if you're running the server in terse logging
mode.

On balance I think it's OK, so I pushed it.  I did take out a couple
of uses of "logical replication" that seemed unnecessary and were
making the length problem worse.

            regards, tom lane

[1] https://www.postgresql.org/docs/devel/error-style-guide.html#ERROR-STYLE-GUIDE-WHAT-GOES-WHERE



pgsql-hackers by date:

Previous
From: Alexander Lakhin
Date:
Subject: Re: speed up a logical replica setup
Next
From: Robert Haas
Date:
Subject: Re: Add a GUC check hook to ensure summarize_wal cannot be enabled when wal_level is minimal