cockroachdb / cockroachdb/cockroach

sql,plpgsql: add support for txn control statements in DO blocks

Open
#138,704 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.