According to the documentation Postgres > CREATE VIEW > Updatable Views , a postgres view is updatable if following set of conditions are met:
The view must have exactly one entry in its FROM list, which must be a table or another updatable view.
The view definition must not contain WITH, DISTINCT, GROUP BY, HAVING, LIMIT, or OFFSET clauses at the top level.
The view definition must not contain set operations (UNION, INTERSECT or EXCEPT) at the top level.
The view's select list must not contain any aggregates, window functions or set-returning functions.
How do I programmatically determine, given a view some_random_view
is updatable or not?
The information_schema.views data dictionary view contains the column is_updatable. The contents of this column tells you if the view is updatable or not.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With