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

Array foreign keys and indexes on arrays/JSON nested fields. When using MongoDB, having this eliminates most need for join tables. (*This may have already been implemented, I haven't used SQL recently.)


I think they have indexes on json (or any selectable thing?).

You could probably implement the foreign key using generated columns these days. Ah I guess you mean instead of having the association table? That would definitely be nice in some cases.


> Array foreign keys

Yes!

We very occasionally use integer[] columns with ids, but hold off on using them widely b/c of the lack of integrity constraints. It'd be awesome to use more often.


PostgreSQL has had indexes on JSON for many years.


Yes! Array of foreign keys would be amazing!




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: