cockroach
cockroach copied to clipboard
sql: add support for INSTEAD OF triggers
This issue tracks adding support for INSTEAD OF triggers to CRDB. INSTEAD OF triggers only operate on views, and completely replace the original mutation operation. They can only be row-level triggers. Generally, an INSTEAD OF trigger maps from a mutation on the view to mutations on the underlying base tables. It is not possible to define a trigger on a materialized view.
Note that CRDB does not currently support direct mutations on views like Postgres does, tracked in https://github.com/cockroachdb/cockroach/issues/20948. This shouldn't be an obstacle to implementing INSTEAD OF triggers, since they entirely replace the mutation anyway.
Epic CRDB-347
Jira issue: CRDB-39863
Jira issue: CRDB-39863
Jira issue: CRDB-39863