Re: name of enum used in 'Cache if PathTarget and RestrictInfos contain volatile functions'

Поиск
Список
Период
Сортировка
От Peter Smith
Тема Re: name of enum used in 'Cache if PathTarget and RestrictInfos contain volatile functions'
Дата
Msg-id CAHut+Puvo8ZLSUa2dnqOND3T_SGZnvWVToMB+wZNPRnbLi3gPA@mail.gmail.com
обсуждение исходный текст
Ответ на name of enum used in 'Cache if PathTarget and RestrictInfos contain volatile functions'  (Zhihong Yu <zyu@yugabyte.com>)
Список pgsql-hackers
On Mon, Mar 29, 2021 at 1:15 PM Zhihong Yu <zyu@yugabyte.com> wrote:
>
> Hi,
> I was looking at:
>   Cache if PathTarget and RestrictInfos contain volatile functions
>
> VOLATILITY_NOVOLATILE caught my attention. Since the enum values don't start with HAS, I think VOLATILITY_NONVOLATILE
wouldbe easier to read.
 
> Actually I think since the enums are defined in VolatileFunctionStatus, they can be simply called (the prefix should
beredundant):
 
>
> UNKNOWN
> NONVOLATILE
> VOLATILE
>

Although it seems like a good idea to remove prefixes, a name as
common as UNKNOWN is going to clash [1] with something else, which
IIUC is why the enums all have prefixes in the first place.

------
[1] https://stackoverflow.com/questions/35380279/avoid-name-collisions-with-enum-in-c-c99

Kind Regards,
Peter Smith.
Fujitsu Australia



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: invalid data in file backup_label problem on windows
Следующее
От: Amit Kapila
Дата:
Сообщение: Re: [PATCH] Provide more information to filter_prepare