Re: [HACKERS] hstore improvements?

2009-03-23 Thread Josh Berkus
On 3/19/09 2:40 PM, Dimitri Fontaine wrote: Hi, Le 19 mars 09 à 21:23, Josh Berkus a écrit : One request I've had is to construct a record (of some supplied composite type) from an hstore. I'm not sure if this is even possible; I'm certainly not seeing a way to implement it. Am I missing

Re: [HACKERS] hstore improvements?

2009-03-20 Thread Andrew Gierth
Josh == Josh Berkus j...@agliodbs.com writes: Tom Lane wrote: Josh Berkus j...@agliodbs.com writes: As an hstore user, I'd be fine with simply limiting it to 64K (or, heck, 8K) and throwing an error. I'd also be fine with limiting keys to 255 bytes, although we'd have to warn people.

Re: [HACKERS] hstore improvements?

2009-03-19 Thread Josh Berkus
Andrew, One request I've had is to construct a record (of some supplied composite type) from an hstore. I'm not sure if this is even possible; I'm certainly not seeing a way to implement it. Am I missing something? Well, presumably you'd try to match hstore tags against the columns of the

Re: [HACKERS] hstore improvements?

2009-03-19 Thread Josh Berkus
On 3/19/09 1:23 PM, Josh Berkus wrote: Andrew, One request I've had is to construct a record (of some supplied composite type) from an hstore. I'm not sure if this is even possible; I'm certainly not seeing a way to implement it. Am I missing something? Well, presumably you'd try to match

Re: [HACKERS] hstore improvements?

2009-03-19 Thread Dimitri Fontaine
Hi, Le 19 mars 09 à 21:23, Josh Berkus a écrit : One request I've had is to construct a record (of some supplied composite type) from an hstore. I'm not sure if this is even possible; I'm certainly not seeing a way to implement it. Am I missing something? Well, presumably you'd try to match

Re: [HACKERS] hstore improvements?

2009-03-17 Thread Andrew Gierth
Andrew == Andrew Gierth and...@tao11.riddles.org.uk writes: Andrew I have a patch almost done that adds some obvious but Andrew currently missing functionality to hstore, specifically the Andrew ability to construct an hstore from a record, and the ability Andrew to construct one from a pair

Re: [HACKERS] hstore improvements?

2009-03-16 Thread Andrew Gierth
Ron == Ron Mayer rm...@cheapcomplexdevices.com writes: Ron Currently hstore gives me an indexed operator to query if a Ron hstore contains a single key. It'd be nice if there were as way Ron to extend this so that I could ask for only records that have Ron all or any the keys in a query.

Re: [HACKERS] hstore improvements?

2009-03-16 Thread Josh Berkus
Ron, I imagine most EAV systems allow multiple values for each attribute - and a hstore that supported this could probably be a pretty nice general solution for many EAV systems. IIRC other people asked about similar on the lists before. Well, not usually. Generally, since EAV systems are

Re: [HACKERS] hstore improvements?

2009-03-16 Thread Ron Mayer
Andrew Gierth wrote: I have a patch almost done that adds some obvious but currently missing functionality to hstore... If there's any other features that people find notably missing from hstore, I could stick them in too; any requests? Currently hstore gives me an indexed operator to query

Re: [HACKERS] hstore improvements?

2009-03-15 Thread Josh Berkus
Tom Lane wrote: Josh Berkus j...@agliodbs.com writes: As an hstore user, I'd be fine with simply limiting it to 64K (or, heck, 8K) and throwing an error. I'd also be fine with limiting keys to 255 bytes, although we'd have to warn people. Yeah, 255 might well be more of a problem than the

Re: [HACKERS] hstore improvements?

2009-03-14 Thread decibel
On Mar 13, 2009, at 4:47 PM, Tom Lane wrote: Or we could increase the size of hstore values so as to provide more than 32 bits total for this, but that would presumably be pessimal for all existing applications; there is evidently no one using more than 64K, or we'd have heard complaints

Re: [HACKERS] hstore improvements?

2009-03-14 Thread Josh Berkus
Tom Lane wrote: I wrote: 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)? Sigh, fingers faster than brain today. A 24-bit length field could represent lengths up to 16MB, not 24MB. Still, it

Re: [HACKERS] hstore improvements?

2009-03-14 Thread Tom Lane
Josh Berkus j...@agliodbs.com writes: As an hstore user, I'd be fine with simply limiting it to 64K (or, heck, 8K) and throwing an error. I'd also be fine with limiting keys to 255 bytes, although we'd have to warn people. Yeah, 255 might well be more of a problem than the other limit. We

[HACKERS] hstore improvements?

2009-03-13 Thread Andrew Gierth
I have a patch almost done that adds some obvious but currently missing functionality to hstore, specifically the ability to construct an hstore from a record, and the ability to construct one from a pair of arrays. If there's any other features that people find notably missing from hstore, I

Re: [HACKERS] hstore improvements?

2009-03-13 Thread Alvaro Herrera
Andrew Gierth wrote: I have a patch almost done that adds some obvious but currently missing functionality to hstore, specifically the ability to construct an hstore from a record, and the ability to construct one from a pair of arrays. If there's any other features that people find notably

Re: [HACKERS] hstore improvements?

2009-03-13 Thread Heikki Linnakangas
Alvaro Herrera wrote: Andrew Gierth wrote: I have a patch almost done that adds some obvious but currently missing functionality to hstore, specifically the ability to construct an hstore from a record, and the ability to construct one from a pair of arrays. If there's any other features that

Re: [HACKERS] hstore improvements?

2009-03-13 Thread Alvaro Herrera
Heikki Linnakangas wrote: Alvaro Herrera wrote: Andrew Gierth wrote: I have a patch almost done that adds some obvious but currently missing functionality to hstore, specifically the ability to construct an hstore from a record, and the ability to construct one from a pair of arrays. If

Re: [HACKERS] hstore improvements?

2009-03-13 Thread David E. Wheeler
On Mar 13, 2009, at 11:06 AM, Andrew Gierth wrote: If there's any other features that people find notably missing from hstore, I could stick them in too; any requests? Can you create slices? That is, create a new hstore as a subset of an existing hstore? Also, hstore has an

Re: [HACKERS] hstore improvements?

2009-03-13 Thread Tom Lane
Alvaro Herrera alvhe...@commandprompt.com writes: Heikki Linnakangas wrote: Alvaro Herrera wrote: Optionally compressing the values would be nice ... The whole Datum will be toasted/compressed if it gets large enough. Is that not enough? It doesn't always gets large enough, and there's

Re: [HACKERS] hstore improvements?

2009-03-13 Thread Tom Lane
David E. Wheeler da...@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

Re: [HACKERS] hstore improvements?

2009-03-13 Thread Andrew Gierth
David == David E Wheeler da...@kineticode.com writes: On Mar 13, 2009, at 11:06 AM, Andrew Gierth wrote: If there's any other features that people find notably missing from hstore, I could stick them in too; any requests? David Can you create slices? That is, create a new hstore as a

Re: [HACKERS] hstore improvements?

2009-03-13 Thread Andrew Gierth
Tom == Tom Lane t...@sss.pgh.pa.us writes: Tom As for truncation rather than throwing an error, I'd argue that Tom that's a flat-out bug and the fix deserves back-patching. Separate patch for that part then? -- Andrew (irc:RhodiumToad) -- Sent via pgsql-hackers mailing list

Re: [HACKERS] hstore improvements?

2009-03-13 Thread David E. Wheeler
On Mar 13, 2009, at 1:21 PM, Andrew Gierth wrote: I'm thinking that (hstore - text[]) should probably return text[], and maybe (hstore = text[]) returning hstore? i.e. select ('a=1,b=2,c=3'::hstore) - ARRAY['a','b']; -- returns '{1,2}' select ('a=1,b=2,c=3'::hstore) = ARRAY['a','b']; --

Re: [HACKERS] hstore improvements?

2009-03-13 Thread Andrew Gierth
David == David E Wheeler da...@kineticode.com writes: select ('a=1,b=2,c=3'::hstore) - ARRAY['a','b']; -- returns '{1,2}' select ('a=1,b=2,c=3'::hstore) = ARRAY['a','b']; -- returns 'a=1,b=2' (by analogy to the existing operators - for lookup and = for construction) David Is

Re: [HACKERS] hstore improvements?

2009-03-13 Thread David E. Wheeler
On Mar 13, 2009, at 2:26 PM, Andrew Gierth wrote: David Is a more Perlish syntax out of the question? Yes. Sorry. David SELECT ('a=1,b=2,c=3'::hstore)['a', 'b']; David -- returns '{1,2}' That would require integrating hstore into core - array subscripting isn't a user-definable operation.

Re: [HACKERS] hstore improvements?

2009-03-13 Thread Tom Lane
David E. Wheeler da...@kineticode.com writes: Is a more Perlish syntax out of the question? Yes. SQL is not Perl. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription:

Re: [HACKERS] hstore improvements?

2009-03-13 Thread David E. Wheeler
On Mar 13, 2009, at 2:35 PM, Tom Lane wrote: Is a more Perlish syntax out of the question? Yes. SQL is not Perl. You mean all this time I thought I was writing Perl when I was using PostgreSQL, and it turns out that it's *not* Perl? That explains the strange lack of sigils. Thanks

Re: [HACKERS] hstore improvements?

2009-03-13 Thread Tom Lane
I wrote: 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)? Sigh, fingers faster than brain today. A 24-bit length field could represent lengths up to 16MB, not 24MB. Still, it seems like a

Re: [HACKERS] hstore improvements?

2009-03-13 Thread Alvaro Herrera
Tom Lane wrote: Or we could increase the size of hstore values so as to provide more than 32 bits total for this, but that would presumably be pessimal for all existing applications; there is evidently no one using more than 64K, or we'd have heard complaints before. Would it work to allow

Re: [HACKERS] hstore improvements?

2009-03-13 Thread Tom Lane
Alvaro Herrera alvhe...@commandprompt.com writes: Tom Lane wrote: Or we could increase the size of hstore values so as to provide more than 32 bits total for this, but that would presumably be pessimal for all existing applications; there is evidently no one using more than 64K, or we'd have