Re: Using defines for protocol characters

From: Tatsuo Ishii <ishii(at)sraoss(dot)co(dot)jp>
To: davecramer(at)gmail(dot)com
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, nathandbossart(at)gmail(dot)com
Subject: Re: Using defines for protocol characters
Date: 2023-08-04 06:42:13
Message-ID: 20230804.154213.272525911870012759.t-ishii@sranhm.sra.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On Thu, 3 Aug 2023 at 16:59, Tatsuo Ishii <ishii(at)sraoss(dot)co(dot)jp> wrote:
>
>> > On Thu, 3 Aug 2023 at 13:25, Tatsuo Ishii <ishii(at)sraoss(dot)co(dot)jp> wrote:
>> >
>> >> > Greetings,
>> >> >
>> >> > Attached is a patch which introduces a file protocol.h. Instead of
>> using
>> >> > the actual characters everywhere in the code this patch names the
>> >> > characters and removes the comments beside each usage.
>> >>
>> >> > +#define DESCRIBE_PREPARED 'S'
>> >> > +#define DESCRIBE_PORTAL 'P'
>> >>
>> >> You use these for Close message as well. I don't like the idea because
>> >> Close is different message from Describe message.
>> >>
>> >> What about adding following for Close too use them instead?
>> >>
>> >> #define CLOSE_PREPARED 'S'
>> >> #define CLOSE_PORTAL 'P'
>> >>
>> >
>> > Good catch.
>> > I recall when writing this it was a bit hacky.
>> > What do you think of PREPARED_SUB_COMMAND and PORTAL_SUB_COMMAND
>> instead
>> > of duplicating them ?
>>
>> Nice. Looks good to me.
>>
> New patch attached which uses PREPARED_SUB_COMMAND and
> PORTAL_SUB_COMMAND instead
> and uses
> PQMSG_REQ_* and PQMSG_RESP_* as per Alvaro's suggestion

Looks good to me.

Best reagards,
--
Tatsuo Ishii
SRA OSS LLC
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Richard Guo 2023-08-04 06:48:33 Fix a comment in paraminfo_get_equal_hashops
Previous Message Andy Fan 2023-08-04 04:38:23 Re: Extract numeric filed in JSONB more effectively