Re: Out-of-memory error reports in libpq

Andrew Dunstan <andrew@dunslane.net>

From: Andrew Dunstan <andrew@dunslane.net>
To: Tom Lane <tgl@sss.pgh.pa.us>, Michael Paquier <michael@paquier.xyz>
Cc: "Bossart, Nathan" <bossartn@amazon.com>, "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>, Alvaro Herrera <alvherre@alvh.no-ip.org>, Peter Geoghegan <pg@bowt.ie>
Date: 2021-07-28T16:25:22Z
Lists: pgsql-hackers
On 7/28/21 11:02 AM, Tom Lane wrote:
>
> Here I've got to disagree.  We do need the form with a PQExpBuffer
> argument, because there are some places where that isn't a pointer
> to a PGconn's errorMessage.  But the large majority of the calls
> are "pqReportOOM(conn)", and I think having to write that as
> "pqReportOOM(&conn->errorMessage)" is fairly ugly and perhaps
> error-prone.
>
> I'm not wedded to the name "pqReportOOMBuffer" though --- maybe
> there's some better name for that one?
>
> 			



Is it worth making the first one a macro?


cheers


andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com




Commits

  1. Improve libpq's handling of OOM during error message construction.

  2. In libpq, always append new error messages to conn->errorMessage.