diff options
author | Tom Lane | 2015-08-25 18:06:13 +0000 |
---|---|---|
committer | Tom Lane | 2015-08-25 18:06:13 +0000 |
commit | 781ed2bfa35f0a8a7ad1029d3a7d7687c73d86a0 (patch) | |
tree | 2f798786223577e5706b8be5157a684b1ccdea0b /src | |
parent | 7b5ef8f2d070c075811ec04a0fcb745d67c7fe3f (diff) |
Further tweak wording of error messages about bad CONTINUE/EXIT statements.
Per discussion, a little more verbosity seems called for.
Diffstat (limited to 'src')
-rw-r--r-- | src/pl/plpgsql/src/pl_gram.y | 3 | ||||
-rw-r--r-- | src/test/regress/expected/plpgsql.out | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/pl/plpgsql/src/pl_gram.y b/src/pl/plpgsql/src/pl_gram.y index a1ae1bbf2cd..841a8d61227 100644 --- a/src/pl/plpgsql/src/pl_gram.y +++ b/src/pl/plpgsql/src/pl_gram.y @@ -1676,7 +1676,8 @@ stmt_exit : exit_type opt_label opt_exitcond if (label == NULL) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), - errmsg("there is no label \"%s\" surrounding this statement", + errmsg("there is no label \"%s\" " + "attached to any block or loop enclosing this statement", $2), parser_errposition(@2))); /* CONTINUE only allows loop labels */ diff --git a/src/test/regress/expected/plpgsql.out b/src/test/regress/expected/plpgsql.out index c1822aadf0a..83c643847d5 100644 --- a/src/test/regress/expected/plpgsql.out +++ b/src/test/regress/expected/plpgsql.out @@ -2864,7 +2864,7 @@ begin end; end; $$ language plpgsql; -ERROR: there is no label "no_such_label" surrounding this statement +ERROR: there is no label "no_such_label" attached to any block or loop enclosing this statement LINE 5: continue no_such_label; ^ -- should fail: no such label @@ -2877,7 +2877,7 @@ begin end; end; $$ language plpgsql; -ERROR: there is no label "no_such_label" surrounding this statement +ERROR: there is no label "no_such_label" attached to any block or loop enclosing this statement LINE 5: exit no_such_label; ^ -- should fail: CONTINUE can't reference the label of a named block |