Re: Out-of-memory error reports in libpq

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Out-of-memory error reports in libpq
Дата
Msg-id YQDP5RAT+OPQ7E3p@paquier.xyz
обсуждение исходный текст
Ответ на Re: Out-of-memory error reports in libpq  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Out-of-memory error reports in libpq
Список 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

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Greg Nancarrow
Дата:
Сообщение: Re: [bug?] Missed parallel safety checks, and wrong parallel safety
Следующее
От: Jeff Davis
Дата:
Сообщение: Re: alter table set TABLE ACCESS METHOD