Re: [GENERAL] json indexing and data types

2015-12-16 Thread Kaare Rasmussen
Hi Oleg This is known problem, that's why we stop developing jsquery and are working on sql-level query language for jsonb, then you'll use all power and extendability of SQL. The idea is to use power of subselects and unnest to unroll jsonb to sql level. There is presentation at pgconf.eu <

Re: [GENERAL] json indexing and data types

2015-12-12 Thread Oleg Bartunov
On Wed, Dec 2, 2015 at 11:48 AM, Kaare Rasmussen wrote: > Hi > > As json essentially only has three basic data types, string, int, and > boolean, I wonder how much of this - to index, search, and sort on > unstructured data - is possible. I guess part of the answer would be > 'jsquery and vodka'

Re: [GENERAL] json indexing and data types

2015-12-03 Thread Jeff Janes
On Wed, Dec 2, 2015 at 8:04 PM, Tom Lane wrote: > Merlin Moncure writes: >> On Wed, Dec 2, 2015 at 12:03 AM, Kaare Rasmussen wrote: >>> As json essentially only has three basic data types, string, int, and >>> boolean, I wonder how much of this - to index, search, and sort on >>> unstructured da

Re: [GENERAL] json indexing and data types

2015-12-03 Thread Jim Nasby
On 12/2/15 10:38 PM, Kaare Rasmussen wrote: On 2015-12-03 01:04, Jim Nasby wrote: We have a client that has a similar (though also a bit different) need. Specifically, they get an XML document that has element attributes that tell you what data type the element should contain. We convert the XML

Re: [GENERAL] json indexing and data types

2015-12-03 Thread Kaare Rasmussen
On 2015-12-03 05:04, Tom Lane wrote: Yeah. The problem here is that a significant part of the argument for the JSON/JSONB datatypes was that they adhere to standards (RFC 7159 in particular). I can't see us accepting a patch that changes them into JSON-plus-some-PG-enhancements. Would be nice

Re: [GENERAL] json indexing and data types

2015-12-03 Thread Merlin Moncure
On Wed, Dec 2, 2015 at 7:11 PM, Jim Nasby wrote: > On 12/2/15 7:06 PM, Merlin Moncure wrote: >> >> > The basics is, that I have a column with what is essentially json data; >> a >> > number of data structures of different depths. Perhaps 10 - 30 top >> levels, >> > and probably no more than 3,

Re: [GENERAL] json indexing and data types

2015-12-03 Thread Merlin Moncure
On Wed, Dec 2, 2015 at 10:04 PM, Tom Lane wrote: > (Having said that, it sure looks to me like JSON's idea of a number is > float/numeric, not merely int. Are you sure you need more capability > in that department, and if so what exactly?) Numeric range searching is good, but the numeric case is

Re: [GENERAL] json indexing and data types

2015-12-02 Thread Kaare Rasmussen
On 2015-12-03 02:06, Merlin Moncure wrote: I feel your pain. jsquery is superb for subdocument searching on *specific* subdocuments but range searching is really limited. Value searching is there for numerics but dates and text range searching are not present. We also have to understand that

Re: [GENERAL] json indexing and data types

2015-12-02 Thread Kaare Rasmussen
On 2015-12-03 01:04, Jim Nasby wrote: We have a client that has a similar (though also a bit different) need. Specifically, they get an XML document that has element attributes that tell you what data type the element should contain. We convert the XML to JSON (easy thanks to plpython), which p

Re: [GENERAL] json indexing and data types

2015-12-02 Thread Tom Lane
Merlin Moncure writes: > On Wed, Dec 2, 2015 at 12:03 AM, Kaare Rasmussen wrote: >> As json essentially only has three basic data types, string, int, and >> boolean, I wonder how much of this - to index, search, and sort on >> unstructured data - is possible. > I feel your pain. jsquery is sup

Re: [GENERAL] json indexing and data types

2015-12-02 Thread Jim Nasby
On 12/2/15 7:06 PM, Merlin Moncure wrote: > The basics is, that I have a column with what is essentially json data; a > number of data structures of different depths. Perhaps 10 - 30 top levels, > and probably no more than 3, max 4 levels deep. In total there are some > hundred thousands of r

[GENERAL] json indexing and data types

2015-12-02 Thread Merlin Moncure
On Wed, Dec 2, 2015 at 12:03 AM, Kaare Rasmussen > wrote: > Hi > > As json essentially only has three basic data types, string, int, and > boolean, I wonder how much of this - to index, search, and sort on > unstructured data - is possible. I guess part of the answer would be > 'jsquery and vodka'

Re: [GENERAL] json indexing and data types

2015-12-02 Thread Jim Nasby
On 12/2/15 12:03 AM, Kaare Rasmussen wrote: The hard part is that some of the data items really have another type. There are dates and floating points, as the most important ones. And the really hard part is that sorting and range searches are important, especially for these two types. Having da

[GENERAL] json indexing and data types

2015-12-01 Thread Kaare Rasmussen
Hi As json essentially only has three basic data types, string, int, and boolean, I wonder how much of this - to index, search, and sort on unstructured data - is possible. I guess part of the answer would be 'jsquery and vodka', but let me describe the problem first. The basics is, that I