Hi,
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? There's plenty code that tries to handle all variants for various
such "poor man's enum"s - the current compiler doesn't allow the
compiler to help defend against forgotten values. And I think there's
plenty cases where we *did* forget updating places for new values,
e.g. around the partitioned table reltype.
Greetings,
Andres Freund