Re: enums - Mailing list pgsql-hackers

From Gregory Maxwell
Subject Re: enums
Date
Msg-id e692861c0510272257n6fb8943fl1bcfd30942f1c35b@mail.gmail.com
Whole thread Raw
In response to Re: enums  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
On 10/27/05, Andrew Dunstan <andrew@dunslane.net> wrote:
> >That seems counter-intuitive. It's also exposing an implimentation
> >detail (that the enum is stored internally as a number).
>
> No it is not. Not in the slightest. It is honoring the enumeration order
> defined for the type. That is the ONLY correct behaviour, IMNSHO.
> Otherwise, you could just as easily use a domain with a check constraint.
>
> In fact, mysql's behaviour is laughably, even ludicrously, inconsistent:
[snip]
> So for "order by" it honors the enumeration order, but for < it uses the
> lexical ordering. Lovely, eh?

Oh wow. That is broken, I didn't try that case because I figured it
would do it right (i.e. use the enum order).


pgsql-hackers by date:

Previous
From: Philip Yarra
Date:
Subject: Re: pl/pgsql breakage in 8.1b4?
Next
From: Gavin Sherry
Date:
Subject: Re: TRAP: FailedAssertion("!((itemid)->lp_flags & 0x01)",