Re: hstore improvements?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: hstore improvements?
Дата
Msg-id 4661.1236975124@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: hstore improvements?  ("David E. Wheeler" <david@kineticode.com>)
Ответы Re: hstore improvements?
Re: hstore improvements?
Список pgsql-hackers
"David E. Wheeler" <david@kineticode.com> writes:
> On Mar 13, 2009, at 11:06 AM, Andrew Gierth wrote:
>> Also, hstore has an (undocumented) limit of 65535 bytes for keys and
>> values, and it does not behave very cleanly when given longer values
>> (it truncates them mod 2^16, rather than erroring). That gives rise to
>> two obvious questions: (1) are those lengths reasonable? they strike
>> me as being rather long for keys and rather short for values; and (2)
>> should exceeding the lengths throw an error?

> I agree. The keys can be much shorter without any threat of loss. Can  
> the value not essentially be TEXT, and thus theoretically unlimited in  
> size?

Well, TEXT is limited to 1GB by the toastable-datum rules, as is the
whole hstore datum, so there's no point in worrying about "huge"
values.  I agree though that 64K is on the small side for a data limit.
If we wanted to keep the lengths in the same 32 bits they presumably
occupy now, what about splitting 8/24 (=> 255 bytes for key, 24MB for
value)?

As for truncation rather than throwing an error, I'd argue that that's
a flat-out bug and the fix deserves back-patching.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: hstore improvements?
Следующее
От: Andrew Gierth
Дата:
Сообщение: Re: hstore improvements?