[PATCH] Reorganize pqcomm.h a bit

Jacob Champion <jacob.champion@enterprisedb.com>

From: Jacob Champion <jacob.champion@enterprisedb.com>
To: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Cc: Jelte Fennema-Nio <postgres@jeltef.nl>, Nathan Bossart <nathandbossart@gmail.com>
Date: 2025-11-21T19:10:12Z
Lists: pgsql-hackers

Attachments

Hi,

I was reviewing a patchset by Jelte [1] and decided that pqcomm.h has
gotten hard to read/organize.

Attached is a patch that groups the magic PG_PROTOCOL() codes, adds a
comment to a typedef that was orphaned when protocol.h arrived, and
tweaks some whitespace to make the "paragraphs" easier to scan (IMHO).
I did have some misgivings about separating CANCEL_REQUEST_CODE from
its packet struct, but I think it's a net improvement.

WDYT?

--Jacob

[1] https://postgr.es/m/DDPR5BPWH1RJ.1LWAK6QAURVAY@jeltef.nl

Commits

  1. Reorganize pqcomm.h a bit