Re: Out-of-memory error reports in libpq - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Out-of-memory error reports in libpq
Date
Msg-id YQDP5RAT+OPQ7E3p@paquier.xyz
Whole thread Raw
In response to Re: Out-of-memory error reports in libpq  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Out-of-memory error reports in libpq
List pgsql-hackers
On Tue, Jul 27, 2021 at 10:31:25PM -0400, Tom Lane wrote:
> Yeah, there are half a dozen places that currently print something
> more specific than "out of memory".  I judged that the value of this
> was not worth the complexity it'd add to support it in this scheme.
> Different opinions welcome of course.

I don't mind either that this removes a bit of context.  For
unlikely-going-to-happen errors that's not worth the extra translation
cost.  No objections from me for an integration into 14 as that's
straight-forward, and that would minimize conflicts between HEAD and
14 in the event of a back-patch

+pqReportOOM(PGconn *conn)
+{
+   pqReportOOMBuffer(&conn->errorMessage);
+}
+
+/*
+ * As above, but work with a bare error-message-buffer pointer.
+ */
+void
+pqReportOOMBuffer(PQExpBuffer errorMessage)
+{
Not much a fan of having two routines to do this job though.  I would
vote for keeping the one named pqReportOOM() with PQExpBuffer as
argument.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Greg Nancarrow
Date:
Subject: Re: [bug?] Missed parallel safety checks, and wrong parallel safety
Next
From: Jeff Davis
Date:
Subject: Re: alter table set TABLE ACCESS METHOD