Re: Improve the connection failure error messages
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Nisha Moond <nisha.moond412@gmail.com>
Cc: Daniel Gustafsson <daniel@yesql.se>, Peter Smith <smithpb2250@gmail.com>,
pgsql-hackers@lists.postgresql.org
Date: 2024-07-11T17:30:23Z
Lists: 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
Commits
-
Improve logical replication connection-failure messages.
- 0d8bd0a72ea2 18.0 landed
-
Fix a random failure in 038_save_logical_slots_shutdown.pl.
- 0b84f5c419a3 17.0 cited
-
Add a failover option to subscriptions.
- 776621a5e479 17.0 cited