Re: Using defines for protocol characters - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Using defines for protocol characters
Date
Msg-id ZN1qe0dYIIKmzOPo@paquier.xyz
Whole thread Raw
In response to Re: Using defines for protocol characters  (Nathan Bossart <nathandbossart@gmail.com>)
Responses Re: Using defines for protocol characters
List pgsql-hackers
On Wed, Aug 16, 2023 at 12:29:56PM -0700, Nathan Bossart wrote:
> I moved the definitions out to a separate file in v6.

Looks sensible seen from here.

This patch is missing the installation of protocol.h in
src/tools/msvc/Install.pm for MSVC.  For pqcomm.h, we are doing that:
lcopy('src/include/libpq/pqcomm.h', $target . '/include/internal/libpq/')
    || croak 'Could not copy pqcomm.h';

So adding two similar lines for protocol.h should be enough (I assume,
did not test).

In fe-exec.c, we still have a few things for the type of objects to
work on:
- 'S' for statement.
- 'P' for portal.
Should these be added to protocol.h?  They are part of the extended
protocol.

The comment at the top of PQsendTypedCommand() mentions 'C' and 'D',
but perhaps these should be updated to the object names instead?

pqFunctionCall3(), for PQfn(), has a few more hardcoded characters for
its status codes.  I'm OK to do things incrementally so it's fine by
me to not add them now, just noticing on the way what could be added
to this new header.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: Rename ExtendedBufferWhat in 16?
Next
From: Michael Paquier
Date:
Subject: Re: Return value of pg_promote()