From: | Kaare Rasmussen <kaare(at)jasonic(dot)dk> |
---|---|
To: | Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>, <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: json indexing and data types |
Date: | 2015-12-03 04:38:18 |
Message-ID: | 565FC73A.60907@jasonic.dk |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
From | Date | Subject | |
---|---|---|---|
Next Message | Kaare Rasmussen | 2015-12-03 04:43:14 | Re: json indexing and data types |
Previous Message | mdaswani | 2015-12-03 04:31:22 | Support for hardware tokens for server/replication private key |