Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit781ed2b

Browse files
committed
Further tweak wording of error messages about bad CONTINUE/EXIT statements.
Per discussion, a little more verbosity seems called for.
1 parent7b5ef8f commit781ed2b

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

‎src/pl/plpgsql/src/pl_gram.y

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1676,7 +1676,8 @@ stmt_exit: exit_type opt_label opt_exitcond
16761676
if (label ==NULL)
16771677
ereport(ERROR,
16781678
(errcode(ERRCODE_SYNTAX_ERROR),
1679-
errmsg("there is no label\"%s\" surrounding this statement",
1679+
errmsg("there is no label\"%s\""
1680+
"attached to any block or loop enclosing this statement",
16801681
$2),
16811682
parser_errposition(@2)));
16821683
/* CONTINUE only allows loop labels*/

‎src/test/regress/expected/plpgsql.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2864,7 +2864,7 @@ begin
28642864
end;
28652865
end;
28662866
$$ language plpgsql;
2867-
ERROR: there is no label "no_such_label"surrounding this statement
2867+
ERROR: there is no label "no_such_label"attached to any block or loop enclosing this statement
28682868
LINE 5: continue no_such_label;
28692869
^
28702870
-- should fail: no such label
@@ -2877,7 +2877,7 @@ begin
28772877
end;
28782878
end;
28792879
$$ language plpgsql;
2880-
ERROR: there is no label "no_such_label"surrounding this statement
2880+
ERROR: there is no label "no_such_label"attached to any block or loop enclosing this statement
28812881
LINE 5: exit no_such_label;
28822882
^
28832883
-- should fail: CONTINUE can't reference the label of a named block

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp