Re: Working with PostgreSQL enums in C code - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: Working with PostgreSQL enums in C code
Date
Msg-id 4C0D9063.9070609@dunslane.net
Whole thread Raw
In response to Re: Working with PostgreSQL enums in C code  (Joseph Adams <joeyadams3.14159@gmail.com>)
List pgsql-hackers

Joseph Adams wrote:
>
> By the way, just curious: why can't the internal representation of an
> enum just be an INT starting from 0 by default, like in C?  That would
> make a heck of a lot more sense, in my opinion.  It might also allow
> users to do things like this in the future:
>
>
>   

Please review the debates over the internal representation from several 
years ago when enums were implemented. Essentially the difficulty is 
that the output function needs to get nothing more than the value 
itself, and that means the representation needs to carry with it some 
information about *which* enum set it is in.

cheers

andrew


pgsql-hackers by date:

Previous
From: Takahiro Itagaki
Date:
Subject: Re: pgstatindex still throws ERROR: value "3220078592" is out of range for type integer
Next
From: Tom Lane
Date:
Subject: Re: [PATCH] Fix leaky VIEWs for RLS