cockroachdb / cockroachdb/cockroach

plpgsql: support duplicate INTO target variables

Open
#121,605 0 comments 0 reactions 0 assignees View on GitHub
A-sql-pgcompat A-sql-plpgsql A-sql-routine 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

In PL/pgSQL, it is possible to use a variable as a target more than once in the same INTO clause:
```
postgres=# CREATE PROCEDURE p() LANGUAGE PLpgSQL AS $$ DECLARE x INT; BEGIN SELECT 1, 2 INTO x, x; RAISE NOTICE '%', x; END $$;
CREATE PROCEDURE
postgres=# CALL p();
NOTICE: 2
CALL
```
This issue tracks adding support for this in CRDB. For now, it is disallowed with an "unimplemented" error.

Jira issue: CRDB-37370

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.