|
|
|
|
|
by adrianmsmith
3339 days ago
|
|
Right, "Computed Columns" are "view-like" columns added to normal tables. So you define your table with a few normal columns, and a few generated columns (which are each expressions over the normal columns, or over other generated columns). On those "generated columns" you can create indexes, reference other tables (foreign keys) or be referenced by other tables (foreign keys). MySQL has a binary JSON data type (like most databases) and also expressions to extract data from those JSON fields. MySQL has a lot of disadvantages vs PostgreSQL, but having foreign keys on elements within JSON (via this mechanism) is a thing MySQL can do that PostgreSQL can't :) (Unless I'm mistaken?) |
|
However on a solution I've implemented on PostgreSQL I expand jsonb as regular field in a view and made that view editable via trigger. This way users can update jsonb_field without being aware of because they edit it through a view as if they are normal fields.