Re: hstore improvements? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: hstore improvements?
Date
Msg-id 4661.1236975124@sss.pgh.pa.us
Whole thread Raw
In response to Re: hstore improvements?  ("David E. Wheeler" <david@kineticode.com>)
Responses Re: hstore improvements?
Re: hstore improvements?
List 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 by date:

Previous
From: Tom Lane
Date:
Subject: Re: hstore improvements?
Next
From: Andrew Gierth
Date:
Subject: Re: hstore improvements?