Re: enums
От | Jim C. Nasby |
---|---|
Тема | Re: enums |
Дата | |
Msg-id | 20051027230448.GX63747@pervasive.com обсуждение исходный текст |
Ответ на | Re: enums (Gregory Maxwell <gmaxwell@gmail.com>) |
Ответы |
Re: enums
|
Список | pgsql-hackers |
On Thu, Oct 27, 2005 at 06:46:24PM -0400, Gregory Maxwell wrote: > So what do you propose we do for a default ordering? I hope you don't > think we should force a sort as though the enum labels were text... I do think that. Or default ordering on whatever type the enum is (I can see enums that are something other than text as useful, though that's a secondary goal). > That almost certainly incorrect for most applications of enums, which > are used to make opaque labels more human compatible. Sorting red before blue doesn't sound very opaque to me... > MySQL's behavior of allowing the user to specify the collation in the > typedef makes a lot of sense to me, it doesn't matter that it actually > works as an artifact of the storage backend. I'd argue that it would > make sense to sort by the specification order even if we changed the > backend to use varchars rather than numbers. 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. If our primary concern is MySQL compatability then we should look at offering two types of enums; one that mirrors their broken stuff and one that works they way you'd actually want it to. -- Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com Pervasive Software http://pervasive.com work: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461
В списке pgsql-hackers по дате отправления: