Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

One feature that's incredibly useful, but not on this list, is the JSON support[0]. Being able to store schemaless documents alongside your structured data is very handy in some instances. Being able to query the JSON documents in a useful manner is also incredible.

[0] https://www.postgresql.org/docs/10/static/datatype-json.html



Not just being able to query them, but to be able to create useful indexes on the data at the same time still. This means you don't have to break out parts of the JSON into separate columns and maintain both a schema and a schemaless setup for them. The indexes aren't going to be as optimized as an index on a single column, but it makes the whole thing a lot more robust in the end than relying on your application or triggers to always keep mirrored columns up to date properly.


The most useful part of JSON support is making your query return data from multiple joins and sub-queries in one field. Then you can just json decode the result instead of fetching tons of rows. You could already do that with xmlagg but nowadays people like their JSON.

> SELECT a.id, JSONB_AGG(b.id) AS b_id FROM a, b GROUP BY a.id




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: