Re: Using defines for protocol characters
От
Nathan Bossart
Тема
Re: Using defines for protocol characters
Дата
Msg-id
20230807183849.GA1244255@nathanxps13
Ответ на
Re: Using defines for protocol characters (Tom Lane)
Список
Дерево обсуждения
Using defines for protocol characters Dave Cramer <davecramer@gmail.com>
Re: Using defines for protocol characters Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: Using defines for protocol characters Dave Cramer <davecramer@gmail.com>
Re: Using defines for protocol characters Nathan Bossart <nathandbossart@gmail.com>
Re: Using defines for protocol characters Tatsuo Ishii <ishii@sraoss.co.jp>
Re: Using defines for protocol characters Dave Cramer <davecramer@gmail.com>
Re: Using defines for protocol characters Tatsuo Ishii <ishii@sraoss.co.jp>
Re: Using defines for protocol characters Dave Cramer <davecramer@gmail.com>
Re: Using defines for protocol characters Tatsuo Ishii <ishii@sraoss.co.jp>
Re: Using defines for protocol characters Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: Using defines for protocol characters Dave Cramer <davecramer@gmail.com>
Re: Using defines for protocol characters Peter Smith <smithpb2250@gmail.com>
Re: Using defines for protocol characters Peter Smith <smithpb2250@gmail.com>
Re: Using defines for protocol characters Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: Using defines for protocol characters Dave Cramer <davecramer@gmail.com>
Re: Using defines for protocol characters Robert Haas <robertmhaas@gmail.com>
Re: Using defines for protocol characters Tom Lane <tgl@sss.pgh.pa.us>
Re: Using defines for protocol characters Nathan Bossart <nathandbossart@gmail.com>
Re: Using defines for protocol characters Robert Haas <robertmhaas@gmail.com>
Re: Using defines for protocol characters Dave Cramer <davecramer@gmail.com>
Re: Using defines for protocol characters Tom Lane <tgl@sss.pgh.pa.us>
Re: Using defines for protocol characters Nathan Bossart <nathandbossart@gmail.com>
Re: Using defines for protocol characters Tatsuo Ishii <ishii@sraoss.co.jp>
Re: Using defines for protocol characters Dave Cramer <davecramer@gmail.com>
Re: Using defines for protocol characters Tatsuo Ishii <ishii@sraoss.co.jp>
Re: Using defines for protocol characters Peter Eisentraut <peter@eisentraut.org>
Re: Using defines for protocol characters Dave Cramer <davecramer@gmail.com>
Re: Using defines for protocol characters Tom Lane <tgl@sss.pgh.pa.us>
Re: Using defines for protocol characters Dave Cramer <davecramer@gmail.com>
Re: Using defines for protocol characters Nathan Bossart <nathandbossart@gmail.com>
Re: Using defines for protocol characters Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: Using defines for protocol characters Nathan Bossart <nathandbossart@gmail.com>
Re: Using defines for protocol characters Tatsuo Ishii <ishii@sraoss.co.jp>
Re: Using defines for protocol characters Nathan Bossart <nathandbossart@gmail.com>
Re: Using defines for protocol characters Tatsuo Ishii <ishii@sraoss.co.jp>
Re: Using defines for protocol characters Michael Paquier <michael@paquier.xyz>
Re: Using defines for protocol characters Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: Using defines for protocol characters Nathan Bossart <nathandbossart@gmail.com>
Re: Using defines for protocol characters Michael Paquier <michael@paquier.xyz>
Re: Using defines for protocol characters Nathan Bossart <nathandbossart@gmail.com>
Re: Using defines for protocol characters Robert Haas <robertmhaas@gmail.com>
Re: Using defines for protocol characters Nathan Bossart <nathandbossart@gmail.com>
Re: Using defines for protocol characters Nathan Bossart <nathandbossart@gmail.com>
Re: Using defines for protocol characters Dave Cramer <davecramer@gmail.com>
Re: Using defines for protocol characters Tatsuo Ishii <ishii@sraoss.co.jp>
Re: Using defines for protocol characters Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: Using defines for protocol characters Dave Cramer <davecramer@gmail.com>
On Mon, Aug 07, 2023 at 02:24:58PM -0400, Tom Lane wrote: > Robert Haas 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. +1 for Tom's suggestion. I have no strong opinion about the prefix, but I do think easing greppability is worthwhile. As mentioned earlier [0], I think we should also consider putting the definitions in pqcomm.h. [0] https://postgr.es/m/20230803185356.GA1144430%40nathanxps13 -- Nathan Bossart Amazon Web Services: https://aws.amazon.com
В списке pgsql-hackers по дате отправления
От: Christoph Heiss
Дата: