Re: enum types and binary queries

Поиск
Список
Период
Сортировка
От Gregory Stark
Тема Re: enum types and binary queries
Дата
Msg-id 87odgn2554.fsf@oxford.xeocode.com
обсуждение исходный текст
Ответ на Re: enum types and binary queries  ("Merlin Moncure" <mmoncure@gmail.com>)
Ответы Re: enum types and binary queries
Список pgsql-hackers
"Merlin Moncure" <mmoncure@gmail.com> writes:

> On 8/30/07, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> "Merlin Moncure" <mmoncure@gmail.com> writes:
>> > I noticed that enums are not available to be queried as binary through
>> > the protocol.
>>
>> What do you think the binary representation ought to be?  Copying OIDs
>> seems pretty useless.
>
> I'm on the fence on this one.
>
> I actually think this would be ok, if you mean pg_enum.oid, or the
> string would be fine too.  I agree that binary protocol is supposed to
> be fast, and I can prefetch the pg_enum table to the client and do the
> magic there.  Many other binary formats do similarly inscrutable
> things.

I think it would be ok only if a pg_dump/pg_restore reliably restored the same
oid->enum value mapping. Otherwise a binary dump is useless. But as I
understand it that's the case currently, is it?

You would also have to have some way for a client to simply look up the enum
mapping. Something like an SRF that returned setof(oid,name).

My first instinct was to just use the enum name but I'm starting to think this
would be better. It is more in line with the promise of enums which is that
the names are just labels and the data internally is fixed size.

--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com


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

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