Re: enum types and binary queries

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: enum types and binary queries
Дата
Msg-id 8516.1188501688@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: enum types and binary queries  (Andrew Dunstan <andrew@dunslane.net>)
Ответы Re: enum types and binary queries
Re: enum types and binary queries
Список pgsql-hackers
Andrew Dunstan <andrew@dunslane.net> writes:
> Merlin Moncure wrote:
>> I noticed that enums are not available to be queried as binary through
>> the protocol.

> The trouble is that an enum doesn't have an immutable internal binary value.

> I guess we could say that the binary value is the integer offset of the 
> value in the enum ordering, and translate it back on input. Providing 
> the binary IO funcs shouldn't be too hard if we do that, unless I'm 
> missing something.

That would be expensive to get, wouldn't it?  The main point of binary
I/O is to be fast, so I'm not excited about an expensive conversion.

What if we just defined the binary format as being identical to the text
format, ie, the enum label?  A bit silly but at least it would eliminate
the gotcha that binary I/O fails.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: enum types and binary queries
Следующее
От: "korry.douglas"
Дата:
Сообщение: Re: enum types and binary queries