cockroachdb / cockroachdb/cockroach

plpgsql: implement cursor declaration with arguments

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

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.