-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This patch adds the `crdb_internal.plpgsql_close` builtin, which closes the cursor with the given name. It returns a `34000` error if there is no cursor with the given name. A following commit will use this to implement the PLpgSQL CLOSE statement. Informs cockroachdb#109709 Release note: None
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Testing crdb_internal.plpgsql_close. | ||
statement ok | ||
BEGIN; | ||
DECLARE foo CURSOR FOR SELECT generate_series(1, 5); | ||
|
||
query T | ||
SELECT name FROM pg_cursors; | ||
---- | ||
foo | ||
|
||
statement ok | ||
SELECT crdb_internal.plpgsql_close('foo'); | ||
|
||
query T | ||
SELECT name FROM pg_cursors; | ||
---- | ||
|
||
statement ok | ||
ABORT; | ||
|
||
statement error pgcode 34000 pq: cursor \"foo\" does not exist | ||
SELECT crdb_internal.plpgsql_close('foo'); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.