Fix error handling in getCopyDataMessage and pqFunctionCall3

From: Anthonin Bonnefoy <anthonin(dot)bonnefoy(at)datadoghq(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Fix error handling in getCopyDataMessage and pqFunctionCall3
Date: 2026-07-22 14:00:06
Message-ID: CAO6_XqpGfm+XHE1OzS=_+jroeDOxhhGa11P3cbm9q2gT05yorA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Currently, any OOM triggered within getNotify and getParameterStatus
will drop the connection and set error_result=true.

However, this error is currently ignored in 2 spots:
getCopyDataMessage and pqFunctionCall3. They will continue to process
the dead connection without reporting the error.

The attached patch fixes the issue by returning the error (-2 for
getCopyDataMessage, the PGresult for pqFunctionCall3) whenever a fatal
error was triggered.

Regards,
Anthonin Bonnefoy

Attachment Content-Type Size
v1-0001-Fix-error-handling-in-getCopyDataMessage-and-pqFu.patch application/octet-stream 1.6 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message ZizhuanLiu X-MAN 2026-07-22 14:30:00 Re: Disallow whole-row index references with virtual generated columns?
Previous Message John Naylor 2026-07-22 13:46:23 arrays over initdb-created types are broken after pg_upgrade