Store and query JSON documents in PostgreSQL