Re: More protocol.h replacements this time into walsender.c - Mailing list pgsql-hackers

From Nathan Bossart
Subject Re: More protocol.h replacements this time into walsender.c
Date
Msg-id aJEQUTYLkS836qu5@nathan
Whole thread Raw
In response to Re: More protocol.h replacements this time into walsender.c  (Álvaro Herrera <alvherre@kurilemu.de>)
Responses Re: More protocol.h replacements this time into walsender.c
List pgsql-hackers
On Mon, Aug 04, 2025 at 02:31:05PM +0200, Álvaro Herrera wrote:
> +/* Replication Protocol, sent by the primary */
> +
> +#define PqReplMsg_WALData                'w'
> +#define PqReplMsg_PrimaryKeepAlive        'k'
> +#define PqReplMsg_PrimaryStatusUpdate    's'
> +
> +/* Replication Protocol, sent by the standby */
> +
> +#define PqReplMsg_StandbyStatus            'r'
> +#define PqReplMsg_HotStandbyFeedback    'h'
> +#define PqReplMsg_RequestPrimaryStatus    'p'

I know I previously +1'd a new prefix for these, but upon further review,
I'm not so sure about that.  The replication protocol uses many of the
existing PqMsg macros already, so it would be a little strange if only a
subset of the replication protocol messages used the special prefix.  And
IMO it would also be weird to duplicate all the macros used by both
protocols.  There's also backups, which use the replication protocol but
have their own special characters [0].  If we're going the prefix route,
would we add another prefix for those, or use the replication one?

[0] https://postgr.es/m/aIOkE7fgvFOu0FI_%40nathan

-- 
nathan



pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: V18 release Notes typo
Next
From: Jim Nasby
Date:
Subject: Re: Enable data checksums by default