5 ms·
Will the JSON type have document indexing or is it just a text store that will validate that it's JSON.
by agotterer 14y ago
Will the JSON type have document indexing or is it just a text store that will validate that it's JSON.
- pyrotechnick 14y agoLooks like it's just validation: http://www.postgresql.org/docs/devel/static/datatype-json.htm http://www.postgresql.org/docs/devel/static/datatype-json.ht...
- sickpig 14y agojust validation, json core type it's intentionally very minimal (see postgres hackers mailing list archives for more details) anyway as a possible workaround just see andrew dustan's post: http://people.planetpostgresql.org/andrew/index.php?/archives/249-Using-PLV8-to-index-JSON.html http://people.planetpostgresql.org/andrew/index.php?/archive...
- fusiongyro 14y agoYou don't necessarily need special support for that. There's no special XML indexing support, but you can use the XPath and XSLT functions to extract the data of interest and index that: CREATE TABLE foo (a_doc xml); CREATE INDEX doc_title ON foo ((xpath('/root@title', a_doc)); I don't see any JSON functions for extracting data in the devel documentation, but that's what you would be waiting on, and it could probably be added by an extension without having to wait for built-in support.
- pygy_ 14y agoThere's no native function, but it can easily be implemented. See sickpig's answer (sibling to your post) for a Javascript-based solution.