Use an enum for RELKIND_*?

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Use an enum for RELKIND_*?
Дата
Msg-id 20181219011308.mopzyvc73nwjzdb6@alap3.anarazel.de
обсуждение исходный текст
Ответы Re: Use an enum for RELKIND_*?  (Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>)
Список pgsql-hackers
Hi,

Right now there's no easy way to use the compiler to ensure that all
places that need to deal with all kinds of relkinds check a new
relkind.  I think we should make that easier by moving RELKIND_* to an
enum, with the existing letters as the value.

Obviously we cannot really do that for FormData_pg_class.relkind, but
switch() statements can easily cast that to RelationRelkind (or whatever
we name it).

Does anybody see a reason not to do so?

Greetings,

Andres Freund


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

Предыдущее
От: Thomas Munro
Дата:
Сообщение: Re: cfbot run pgindent?
Следующее
От: Kyotaro HORIGUCHI
Дата:
Сообщение: Re: Use an enum for RELKIND_*?