forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
plpgsql: add execution support for OPEN statements
This patch adds support for executing PLpgSQL OPEN statements, which open a SQL cursor in the current transaction. The name of the cursor is supplied through a PLpgSQL variable. Since the `REFCURSOR` type hasn't been implemented yet, this patch uses `STRING` in the meantime. Limitations that will be lifted in future PRs: 1. Unnamed cursor declarations are not supported. If a cursor is opened with no name supplied, a name should be automatically generated. 2. Bound cursors are not yet supported. It should be possible to declare a cursor in the `DECLARE` block with the query already defined, at which point it can be opened with `OPEN <cursor>;`. 3. A cursor cannot be opened in a routine with an exception block. This is because correct handling of this case is waiting on separate work to implement rollback of changes to database state on exceptions. Informs cockroachdb#109709 Release note (sql change): Added initial support for executing the PLpgSQL `OPEN` statement, which allows a PLpgSQL routine to create a cursor. Currently, opening bound or unnamed cursors is not supported. In addition, `OPEN` statements cannot be used in a routine with an exception block.
- Loading branch information
1 parent
a725fa9
commit 575c3b5
Showing
14 changed files
with
853 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.