Re: enum bug - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: enum bug
Date
Msg-id 20160314154803.GA200960@alvherre.pgsql
Whole thread Raw
In response to Re: enum bug  ("Joshua D. Drake" <jd@commandprompt.com>)
Responses Re: enum bug  ("Joshua D. Drake" <jd@commandprompt.com>)
Re: enum bug  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-general
Joshua D. Drake wrote:
> On 03/11/2016 03:19 PM, Elein wrote:
>
> >An unused (yet) enum type cannot display the enum ranges. An empty table
> >containing that type cannot display enum ranges.
> >
> >The example selects were what I did to figure out that enum_ranges only
> >worked on existing data. Sorry if they were confusing. But the way enum
> >values are currently displayed is confusing.
> >
> >Enums are evil because of the difficulty working with them. They should
> >be used for a fixed set of valid values. Otherwise use a lookup table.
>
> "Otherwise use a lookup table."
>
> That is the solution to this problem.

You know, I suspect this Elein person may know a bit about these
database thingies(*).

I don't think she is complaining because she cannot find her way around
designing a garment color table; rather it seems to me she is pointing
out actual problems in our design of the enum feature because she would
like to see it improve.  If improved enough, maybe we could get to a
point where they could actually be used; otherwise why the heck did we
let the feature in the database in the first place?  I think all these
"use a lookup table, you silly!" answers are missing the point.


(*) Yes, I'm being a bit sarcastic here, sorry about that.  I actually
learned quite a bit of database design and related topics by translating
the "General Bits" column she used to write, many years ago.

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


pgsql-general by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: enum bug
Next
From: "Joshua D. Drake"
Date:
Subject: Re: enum bug