-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Open
Labels
A-schema-changesA-schema-transactionalC-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)T-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)SQL Foundations Team (formerly SQL Schema + SQL Sessions)docs-donedocs-known-limitation
Description
Currently, we can’t refresh a materialized view inside an explicit transaction:
demo@127.0.0.1:26257/movr OPEN> REFRESH MATERIALIZED VIEW overdrawn_accounts;
ERROR: cannot refresh view in an explicit transaction
SQLSTATE: 25000Refresh is an asynchronous job which can be difficult for use to handle inside a transaction.
This is problematic because many users leverage ORMs who often wrap all SQL inside explicit transactions. As a result, a developer could create a materialized view but not be able to refresh it, rendering it unusable. We should support transactional refreshes both for this use case and because developers may want to leverage the results of a refreshed view later on within an explicit transaction.
Jira issue: CRDB-7833
trourance
Metadata
Metadata
Assignees
Labels
A-schema-changesA-schema-transactionalC-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)T-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)SQL Foundations Team (formerly SQL Schema + SQL Sessions)docs-donedocs-known-limitation