Re: enums

From: Michael Glaesemann <grzm(at)myrealbox(dot)com>
To: tshipley(at)deru(dot)com
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: enums
Date: 2005-10-28 00:39:31
Message-ID: 20B975DA-2A24-4E50-AF2E-47CFFE9BDDC7@myrealbox.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On Oct 28, 2005, at 9:23 , Trent Shipley wrote:

> 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.

Relational databases already have a type for unordered sets: tables.
IMO, if there's going to be a separate enumerated type, it should be
more than just an alternative way of defining a set of key-value pairs.

Michael Glaesemann
grzm myrealbox com

In response to

  • Re: enums at 2005-10-28 00:23:02 from Trent Shipley

Responses

  • Re: enums at 2005-10-28 01:58:21 from Trent Shipley

Browse pgsql-hackers by date

  From Date Subject
Next Message Grzegorz Jaskiewicz 2005-10-28 00:55:58 SOLVED Re: _penalty gist method invoked with one key NULL
Previous Message Trent Shipley 2005-10-28 00:23:02 Re: enums