On Sat, Jul 15, 2023 at 12:57 PM Amit Kapila <amit.kapil...@gmail.com> wrote: > > > > Since the numerical value is important only in invalid message type > > cases, how about using a format like "??? (88)" in unknown message > > type cases, in both error and context messages? > > > > Do you have something like attached in mind?
Prologue of psprintf() says * Errors are not returned to the caller, but are reported via elog(ERROR) * in the backend, or printf-to-stderr-and-exit() in frontend builds. * One should therefore think twice about using this in libpq. If an error occurs in psprintf(), it will throw an error which will override the original error. I think we should avoid any stuff that throws further errors. -- Best Wishes, Ashutosh Bapat