Re: Use PqMsg_* macros in basebackup_copy.c

Fabrízio de Royes Mello <fabriziomello@gmail.com>

From: Fabrízio de Royes Mello <fabriziomello@gmail.com>
To: Nathan Bossart <nathandbossart@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-07-25T17:06:12Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Expand usage of macros for protocol characters.

On Fri, Jul 25, 2025 at 12:34 PM Nathan Bossart <nathandbossart@gmail.com>
wrote:
>
> On Fri, Jul 25, 2025 at 11:47:52AM -0300, Fabrízio de Royes Mello wrote:
> > Attached patch for $SUBJECT.
>
> Could we move this to the existing thread on the topic [0]?  I see one
more
> CopyData character in this file, plus some others that probably need their
> own characters in protocol.h:
>

Absolutely

> ./basebackup_copy.c:146:        mysink->msgbuffer[0] = 'd'; /* archive or
manifest data */

Missed that one.

> ./basebackup_copy.c:173:        pq_sendbyte(&buf, 'n');         /* New
archive */
> ./basebackup_copy.c:224:                        pq_sendbyte(&buf, 'p');
/* Progress report */
> ./basebackup_copy.c:250:        pq_sendbyte(&buf, 'p');         /*
Progress report */
> ./basebackup_copy.c:265:        pq_sendbyte(&buf, 'm');         /*
Manifest */
>

Was doing a separate patch but agreed to do everything in the same
thread/patch.

Regards,

--
Fabrízio de Royes Mello