Re: json indexing and data types - Mailing list pgsql-general

From Kaare Rasmussen
Subject Re: json indexing and data types
Date
Msg-id 565FC73A.60907@jasonic.dk
Whole thread Raw
In response to Re: json indexing and data types  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
Responses Re: json indexing and data types  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
List pgsql-general
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 produces a
> bunch of nested JSON objects (typed as specifically as possible in
> JSON). The XML attributes get turned into items in an object. So

OK, AFAIUI, you added the schema to each row. I think that I have fewer
variations, so perhaps the information would live better outside, but
that's a detail. Turning them into tables and views is a good way to
represent the indexable data. Functionally, it seems to me to be almost
the same as functional indexing, but much more transparent, and easier
to write a query for,

> Are you in control of the JSON itself, and are the number of
> permutations known in advance? It might be that something like table
> inheritance is a better solution...

Yes, I can alter the db specification. Not sure how table inheritance
would help, though?

/kaare


pgsql-general by date:

Previous
From: mdaswani
Date:
Subject: Support for hardware tokens for server/replication private key
Next
From: Kaare Rasmussen
Date:
Subject: Re: json indexing and data types