Re: enums

Поиск
Список
Период
Сортировка
От Cristian Prieto
Тема Re: enums
Дата
Msg-id 003901c5db5f$e9078f50$6500a8c0@gt.ClickDiario.local
обсуждение исходный текст
Ответ на Re: enums  (Andrew Dunstan <andrew@dunslane.net>)
Ответы Re: enums  (Andrew Dunstan <andrew@dunslane.net>)
Список pgsql-hackers
What about use the declaration order as the enum order?, for example: if I
declare something like: "CREATE ENUM hola ('item1', 'item3', 'item2');"
-this is just assuming an hypothetical approach to use enum types in this
way- and the logical order of the items could be 'item1', 'item3', 'item2'
just because the user decided to create them in this way.

Well, that's just an idea...

-----Original Message-----
From: pgsql-hackers-owner@postgresql.org
[mailto:pgsql-hackers-owner@postgresql.org] On Behalf Of Andrew Dunstan
Sent: Jueves, 27 de Octubre de 2005 07:06 p.m.
To: tshipley@deru.com
Cc: pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] enums



Trent Shipley wrote:

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

No it's not. Many languages define enumerated types as having a fixed 
ordering. It is not just a set. That is the sense in which I am using 
the term. And, after all, you can always write a function that gives you 
an alternative ordering. All we are building in is an ordering based in 
the enumeration order, which you are at perfect liberty not to use. 
Postgres lets you define an alternative operator class for any type, so 
we are very flexible. People are getting way too hung up over this.

cheers

andrew

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate      subscribe-nomail command to
majordomo@postgresql.orgso that your      message can get through to the mailing list cleanly
 



В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Jim C. Nasby"
Дата:
Сообщение: Re: enums
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: enums