How to correctly use JSON in PostgreSQL