Re: Symbolic names for the values of typalign and typstorage - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Symbolic names for the values of typalign and typstorage
Date
Msg-id 16026.1583521817@sss.pgh.pa.us
Whole thread Raw
In response to Re: Symbolic names for the values of typalign and typstorage  (Andres Freund <andres@anarazel.de>)
List 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 by date:

Previous
From: Aleksei Ivanov
Date:
Subject: Re: Proposal: PqSendBuffer removal
Next
From: Tom Lane
Date:
Subject: Re: Unicode escapes with any backend encoding