Re: Working with PostgreSQL enums in C code

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Joseph Adams <joeyadams3(dot)14159(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Working with PostgreSQL enums in C code
Date: 2010-06-08 00:35:47
Message-ID: 4C0D9063.9070609@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message KaiGai Kohei 2010-06-08 00:46:27 Re: [PATCH] Fix leaky VIEWs for RLS
Previous Message Takahiro Itagaki 2010-06-08 00:30:07 Re: pgstatindex still throws ERROR: value "3220078592" is out of range for type integer