Re: BackendKeyData is mandatory?

Jelte Fennema-Nio <postgres@jeltef.nl>

From: Jelte Fennema-Nio <postgres@jeltef.nl>
To: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: Jacob Champion <jacob.champion@enterprisedb.com>, Tatsuo Ishii <ishii@postgresql.org>, tgl@sss.pgh.pa.us, peter@eisentraut.org, pgsql-hackers@postgresql.org, Dave Cramer <davecramer@gmail.com>
Date: 2025-08-08T06:44:30Z
Lists: pgsql-hackers
On Fri, 8 Aug 2025 at 00:03, Heikki Linnakangas <hlinnaka@iki.fi> wrote:
> That was not necessary for handleSyncLoss() to work, or for any other
> errors. If an error has occurred, PQgetResult() returns an error result,
> which is handled here.

You're right. I think I simply forgot to remove that in v3 (it was
necessary for v2). I'd say let's remove that check and keep the error
path closer to the behavior in other places.

Feel free to tweak/remove the copy-pasted comments as you see fit.



Commits

  1. Revert unnecessary check for NULL

  2. libpq: Be strict about cancel key lengths

  3. libpq: Handle OOM by disconnecting instead of hanging or skipping msgs

  4. libpq: Complain about missing BackendKeyData later with PGgetCancel()