Re: [PATCH] Reorganize pqcomm.h a bit

From: Jacob Champion <jacob(dot)champion(at)enterprisedb(dot)com>
To: Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Nathan Bossart <nathandbossart(at)gmail(dot)com>
Subject: Re: [PATCH] Reorganize pqcomm.h a bit
Date: 2025-11-21 22:01:19
Message-ID: CAOYmi+=Y=7_34VrtGks4neVsoMYFXbpmT4FQ2F=xxy9OvvunWA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Nov 21, 2025 at 1:39 PM Jelte Fennema-Nio <postgres(at)jeltef(dot)nl> wrote:
> Overall seems like reasonable restructuring. I think this note feels out of place now though:
>
> * The cancel request code must not match any protocol version number
> * we're ever likely to use. This random choice should do.
>
> I think it'd be better to remove that paragraph and maybe extend the section intro to be something like this (feel free to change/ignore as you see fit):

Good point. I think "actual protocol version" might get a little
confusing for a casual reader if/when your _GREASE macro arrives,
though. I'll do some wordsmithing.

> Finally, the newline addition at line 71 I don't understand the purpose of.

This header file separates some sections with two empty lines (though
there appears to be no consistency), and if we're going to do that
anyway, then it scans easier IMO to have the PG_PROTOCOL section set
off from the socket section preceding it. I did the same thing for
some of the typedefs and ALPN code later on, though I'm not wedded to
that (or any of it) if it makes things worse for others.

Thanks,
--Jacob

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2025-11-21 22:06:36 Re: apply_scanjoin_target_to_paths and partitionwise join
Previous Message Jelte Fennema-Nio 2025-11-21 21:39:12 Re: [PATCH] Reorganize pqcomm.h a bit