cockroachdb / cockroachdb/cockroach
plpgsql: implement cursor declaration with arguments
Open
A-sql-plpgsql
C-enhancement
docs-done
docs-known-limitation
T-sql-queries
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
Postgres allows declaring a cursor with placeholders, which are filled in by arguments supplied to the OPEN statement. This issue tracks adding support for this feature. Postgres docs here: https://www.postgresql.org/docs/current/plpgsql-cursors.html#PLPGSQL-CURSOR-DECLARATIONS.
Ex:
```
DECLARE
foo CURSOR (x INT, y INT) FOR SELECT x + y;
BEGIN
OPEN foo (1, 2);
END
```
Jira issue: CRDB-35331
Contributor guide
Assessment
This issue has not been assessed yet.