Hacker News new | ask | show | jobs
by StavrosK 2218 days ago
I find that using JSON for things you don't need to query/validate (like big blobs you just want to store) and breaking the rest out to columns works well enough. Plus, you can always migrate the data out to a field anyway.
1 comments

Postgres 12 has generated columns, so you can throw your data in a jsonb column and have Postgres pull data out of it into separate columns for indexing for example.
Generated columns are not necessary for indexing in Postgres, you can create an index on any expression based on the record (supported by many versions now).