diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2008-09-10 01:09:45 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2008-09-10 01:09:45 +0000 |
| commit | 3c221c3dae5978ef3668000a3b7166e2a4f9a750 (patch) | |
| tree | ef03adf42d9e647b7e7aa1272e1ab064b597817d /src | |
| parent | ee33b95d9c2ecec170bc517783d7268a4bd0c793 (diff) | |
Fix a couple of places where the plpgsql grammar would produce an unhelpful
'syntax error' message, rather than something that might draw one's
attention to a missing or wrong-type variable declaration. Per recent
gripe.
Diffstat (limited to 'src')
| -rw-r--r-- | src/pl/plpgsql/src/gram.y | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/pl/plpgsql/src/gram.y b/src/pl/plpgsql/src/gram.y index cf3c751cc0b..89db55231fb 100644 --- a/src/pl/plpgsql/src/gram.y +++ b/src/pl/plpgsql/src/gram.y @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/pl/plpgsql/src/gram.y,v 1.114 2008/09/02 20:37:55 tgl Exp $ + * $PostgreSQL: pgsql/src/pl/plpgsql/src/gram.y,v 1.115 2008/09/10 01:09:45 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -741,6 +741,18 @@ getdiag_target : T_SCALAR check_assignable(yylval.scalar); $$ = yylval.scalar->dno; } + | T_ROW + { + yyerror("expected an integer variable"); + } + | T_RECORD + { + yyerror("expected an integer variable"); + } + | T_WORD + { + yyerror("expected an integer variable"); + } ; @@ -1669,6 +1681,18 @@ cursor_variable : T_SCALAR } $$ = (PLpgSQL_var *) yylval.scalar; } + | T_ROW + { + yyerror("expected a cursor or refcursor variable"); + } + | T_RECORD + { + yyerror("expected a cursor or refcursor variable"); + } + | T_WORD + { + yyerror("expected a cursor or refcursor variable"); + } ; exception_sect : |
