Commit 781ed2bf authored by Tom Lane's avatar Tom Lane

Further tweak wording of error messages about bad CONTINUE/EXIT statements.

Per discussion, a little more verbosity seems called for.
parent 7b5ef8f2
...@@ -1676,7 +1676,8 @@ stmt_exit : exit_type opt_label opt_exitcond ...@@ -1676,7 +1676,8 @@ stmt_exit : exit_type opt_label opt_exitcond
if (label == NULL) if (label == NULL)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_SYNTAX_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), $2),
parser_errposition(@2))); parser_errposition(@2)));
/* CONTINUE only allows loop labels */ /* CONTINUE only allows loop labels */
......
...@@ -2864,7 +2864,7 @@ begin ...@@ -2864,7 +2864,7 @@ begin
end; end;
end; end;
$$ language plpgsql; $$ 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; LINE 5: continue no_such_label;
^ ^
-- should fail: no such label -- should fail: no such label
...@@ -2877,7 +2877,7 @@ begin ...@@ -2877,7 +2877,7 @@ begin
end; end;
end; end;
$$ language plpgsql; $$ 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; LINE 5: exit no_such_label;
^ ^
-- should fail: CONTINUE can't reference the label of a named block -- should fail: CONTINUE can't reference the label of a named block
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment