Re: enum types and binary queries

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: enum types and binary queries
Дата
Msg-id 46D83055.3000109@dunslane.net
обсуждение исходный текст
Ответ на Re: enum types and binary queries  (Gregory Stark <stark@enterprisedb.com>)
Список pgsql-hackers

Gregory Stark wrote:
> enum OIDs are unique across enums? This seems like a strange way to do it. I
> recall conversations about this a while back though and there were limitations
> of the type system that led to this, right?
>   

No, not the type system as such. It stems from this quote from Tom:

> If an output function depends on anything more than the contents of
> the object it's handed, it's vulnerable to being lied to.
> http://archives.postgresql.org/pgsql-hackers/2005-04/msg00998.php

So the value passed to the enum_out function has to be sufficiently 
unique to be able to look up the label. This arrangement got the best 
combination of compactness and simplicity that we could come up with at 
the time.

Incidentally, FWIW, I have heard tales of considerable speedup from 
people being able to avoid using FKs/lookup tables by using enums.

cheers

andrew



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: enum types and binary queries
Следующее
От: Decibel!
Дата:
Сообщение: Re: Password requirement in windows installer