Re: Symbolic names for the values of typalign and typstorage

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Symbolic names for the values of typalign and typstorage
Date: 2020-03-06 19:10:17
Message-ID: 16026.1583521817@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund <andres(at)anarazel(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2020-03-06 19:19:13 Re: Unicode escapes with any backend encoding
Previous Message Aleksei Ivanov 2020-03-06 19:09:23 Re: Proposal: PqSendBuffer removal