From: | Peter Smith <smithpb2250(at)gmail(dot)com> |
---|---|
To: | Dave Cramer <davecramer(at)gmail(dot)com> |
Cc: | Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Tatsuo Ishii <ishii(at)sraoss(dot)co(dot)jp>, pgsql-hackers(at)lists(dot)postgresql(dot)org, nathandbossart(at)gmail(dot)com |
Subject: | Re: Using defines for protocol characters |
Date: | 2023-08-07 08:41:52 |
Message-ID: | CAHut+PuE-3tc_6m06bwnjftk2KBM728ZSDhuL1_=vRCfEGMZ1A@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hi, I wondered if any consideration was given to using an enum instead
of all the #defines.
I guess, your patch would not be much different; you can still have
all the nice names and assign the appropriate values to the enum
values same as now, but using an enum you might also gain
type-checking in the code and also get warnings for the "switch"
statements if there are any cases accidentally omitted.
For example, see typedef enum LogicalRepMsgType [1].
Kind Regards,
Peter Smith
Fujitsu Australia
From | Date | Subject | |
---|---|---|---|
Next Message | Andrey Lepikhov | 2023-08-07 08:51:52 | Re: [PoC] Reducing planning time when tables have many partitions |
Previous Message | Drouvot, Bertrand | 2023-08-07 08:34:43 | Fix badly generated entries in wait_event_names.txt |