Re: Symbolic names for the values of typalign and typstorage

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Symbolic names for the values of typalign and typstorage
Дата
Msg-id 16026.1583521817@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Symbolic names for the values of typalign and typstorage  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> On 2020-03-02 17:52:17 -0500, Tom Lane wrote:
>> While looking at Tomas' ALTER TYPE patch, I got annoyed by the fact
>> that all of the backend writes constants of type alignment and type
>> storage values as literal characters, such as 'i' and 'x'.  This is
>> not our style for most other "poor man's enum" catalog columns, and
>> it makes it really hard to grep for relevant code.  Hence, attached
>> is a proposed patch to invent #define names for those values.

> Independent of the patch, why aren't we using proper enums for some of
> these?

I did think about that, but since the underlying storage needs to be
a "char", I'm not sure that using an enum for the values would really
be all that helpful.  We might get warnings from pickier compilers,
and we wouldn't necessarily get the warnings we actually want.

            regards, tom lane



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

Предыдущее
От: Aleksei Ivanov
Дата:
Сообщение: Re: Proposal: PqSendBuffer removal
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Unicode escapes with any backend encoding