Re: enums

From: Trent Shipley <tshipley(at)deru(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: enums
Date: 2005-10-28 00:23:02
Message-ID: 200510271723.03405.tshipley@deru.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thursday 2005-10-27 16:22, Andrew Dunstan wrote:
> Jim C. Nasby wrote:
> >Like I said, if we're going to support a concept of ordering of items in
> >an enum then we need to support it fully. For starters that means having
> >the ability to re-order things in an enum seamlessly.
>
> I do not see this at all. An enumeration defines an ordering and a set
> of labels. Why should you be able to change it? If you want a different
> ordering, create a new enumeration. Let's do this right because it's a
> feature worth having, not just mimic the competition's idiocy
>

The symbols in the set have no _per se_ order.
A collation rule is necessary to sort the symbols consistently.
ASCII is an enumeration
Unicode is a large enumeration with a simple naive collation and a complex
default collation.

Defining a set results in an unordered specification of symbols.
Defining a collation produces an ordering for the set.
There can be many collations for a set.

An enumeration is just a computer science short-hand way to define a set and a
"native" collation for the set.
An enumeration's native collation need not be the only, or even the most
common, collation for the enumerated set of symbols.

In response to

  • Re: enums at 2005-10-27 23:22:19 from Andrew Dunstan

Responses

  • Re: enums at 2005-10-28 00:39:31 from Michael Glaesemann
  • Re: enums at 2005-10-28 01:05:40 from Andrew Dunstan

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Glaesemann 2005-10-28 00:39:31 Re: enums
Previous Message Mark Kirkwood 2005-10-28 00:21:50 TODO Item - Add system view to show free space map contents