cockroachdb / cockroachdb/cockroach

plpgsql: different error message for root block

Open
#122,169 0 comments 0 reactions 0 assignees View on GitHub
A-sql-plpgsql A-sql-routine C-bug O-qa T-sql-queries
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

```sql
DROP PROCEDURE IF EXISTS p;
CREATE PROCEDURE p() LANGUAGE PLpgSQL AS $$
<>
BEGIN
<>
LOOP
continue block_label WHEN true;
END LOOP;
END;
$$;
CALL p();
```
```
-- postgres: ERROR: 42601: block label "block_label" cannot be used in CONTINUE
-- crdb: ERROR: there is no label "block_label" attached to any block or loop enclosing this statement
```
I think the difference is only present for the root block (as if the root block's label is ignored).

Jira issue: CRDB-37737

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.