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

From Tom Lane
Subject Re: Using defines for protocol characters
Date
Msg-id 838284.1691432698@sss.pgh.pa.us
Whole thread Raw
In response to Re: Using defines for protocol characters  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Using defines for protocol characters
Re: Using defines for protocol characters
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> IMHO, the correspondence between the names in the patch and the
> traditional names in the documentation could be stronger. For example,
> the documentation mentions EmptyQueryResponse and
> NegotiateProtocolVersion, but in this patch those become
> PQMSG_RESP_NEGOTIATE_PROTOCOL and PQMSG_RESP_EMPTY_QUERY. I think we
> could consider directly using the names from the documentation, right
> down to capitalization, perhaps with a prefix, but I'm also totally
> fine with this use of uppercase letters and underscores. But why not
> do a strict translation, like EmptyQueryResponse ->
> PQMSG_EMPTY_QUERY_RESPONSE, NegotiateProtocolVersion ->
> PQMSG_NEGOTIATE_PROTOCOL_VERSION? To me at least, the current patch is
> inventing new and slightly different names for things that already
> have names...

+1.  For ease of greppability, maybe even PQMSG_EmptyQueryResponse
and so on?  Then one grep would find both uses of the constants and
code/docs references.  Not sure if the prefix should be all-caps or
not if we go this way.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Performance degradation on concurrent COPY into a single relation in PG16.
Next
From: Bruce Momjian
Date:
Subject: Re: Partial aggregates pushdown