in reply to Need something like a SQL query for JSON data structures (JSON::XS)

TWIMC, see also PostgreSQL 9.3 JSON functions and JSON data type.

(PostgreSQL version 9.3 will be released next week (if it's ready))

(Update 2021) For future reference:

JSON Functions, incl. detail on JSON indexing

JSON data types (note the plural)

( TL/DR: with PostgreSQL, use JSONB instead of JSON. JSONB (binary JSON) has better indexing and other advantages. )

Both pages contain details about postgresql support for JSONPATH (SQL Standard compliant, indexable, very fast).

  • Comment on Re: Need something like a SQL query for JSON data structures (JSON::XS) (PostgreSQL)