From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Symbolic names for the values of typalign and typstorage
Date: Fri, 06 Mar 2020 14:10:17 -0500
Message-ID: <16026.1583521817@sss.pgh.pa.us> (raw)
In-Reply-To: <20200306181826.ls7i2espox52epaq@alap3.anarazel.de>
References: <16457.1583189537@sss.pgh.pa.us>
<20200306181826.ls7i2espox52epaq@alap3.anarazel.de>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, andres@anarazel.de, pgsql-hackers@lists.postgresql.org
Subject: Re: Symbolic names for the values of typalign and typstorage
In-Reply-To: <16026.1583521817@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox