Re: pgsql: Make cancel request keys longer

Jacob Champion <jacob.champion@enterprisedb.com>

From: Jacob Champion <jacob.champion@enterprisedb.com>
To: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: Peter Eisentraut <peter@eisentraut.org>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>, Jelte Fennema-Nio <postgres@jeltef.nl>
Date: 2025-05-23T21:59:44Z
Lists: pgsql-hackers
On Thu, May 8, 2025 at 11:38 PM Heikki Linnakangas <hlinnaka@iki.fi> wrote:
> It didn't occur to me that you could write it simply as 'msgLength - 4'.
> That depends on knowing that the preceding fields are exactly 4 bytes
> long, but that's clear enough if we just add a comment on that, see
> attached.

Sorry for the conference delay; this looks fine to me.

One of the side effects of the uint8 change is that the client now
accepts cancel keys up to roughly 30kb. Is that intended?

--Jacob



Commits

  1. Use 'void *' for arbitrary buffers, 'uint8 *' for byte arrays

  2. Use more mundane 'int' type for cancel key lengths in libpq

  3. Fix a few oversights in the longer cancel keys patch

  4. Make cancel request keys longer