cockroachdb / cockroachdb/cockroach
sql,plpgsql: add support for txn control statements in DO blocks
Open
A-sql-plpgsql
C-enhancement
T-sql-queries
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
This issue tracks adding support for transaction control statements (`COMMIT`, `ROLLBACK`) within a `DO` statement. From the Postgres docs:
>In procedures invoked by the CALL command as well as in anonymous code blocks (DO command), it is possible to end transactions using the commands COMMIT and ROLLBACK.
Simple example:
```
postgres=# DO $$ BEGIN COMMIT; END $$;
DO
```
Jira issue: CRDB-46305
Contributor guide
Assessment
This issue has not been assessed yet.