1- /* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.addons,v 1.2 2008/12/29 17:07:05 meskes Exp $ */
1+ /* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.addons,v 1.3 2009/01/23 12:43:32 petere Exp $ */
22
33ECPG: stmtClosePortalStmt block
44{
@@ -7,7 +7,7 @@ ECPG: stmtClosePortalStmt block
77if (pg_strcasecmp($1+strlen("close "), "database") == 0)
88{
99if (connection)
10- mmerror(PARSE_ERROR, ET_ERROR, "no at optionfor close database statement\n ");
10+ mmerror(PARSE_ERROR, ET_ERROR, "AT optionnot allowed in CLOSE DATABASE statement");
1111
1212fprintf(yyout, "{ ECPGdisconnect(__LINE__, \"CURRENT\");");
1313whenever_action(2);
@@ -21,7 +21,7 @@ ECPG: stmtClosePortalStmt block
2121ECPG: stmtDeallocateStmt block
2222{
2323if (connection)
24- mmerror(PARSE_ERROR, ET_ERROR, "no at optionfor deallocate statement\n ");
24+ mmerror(PARSE_ERROR, ET_ERROR, "AT optionnot allowed in DEALLOCATE statement");
2525
2626output_deallocate_prepare_statement($1);
2727}
@@ -59,7 +59,7 @@ ECPG: stmtViewStmt rule
5959| ECPGConnect
6060{
6161if (connection)
62- mmerror(PARSE_ERROR, ET_ERROR, "no at optionfor connect statement\n ");
62+ mmerror(PARSE_ERROR, ET_ERROR, "AT optionnot allowed in CONNECT statement");
6363
6464fprintf(yyout, "{ ECPGconnect(__LINE__, %d, %s, %d); ", compat, $1, autocommit);
6565reset_variables();
@@ -73,7 +73,7 @@ ECPG: stmtViewStmt rule
7373| ECPGDeallocateDescr
7474{
7575if (connection)
76- mmerror(PARSE_ERROR, ET_ERROR, "no at optionfor deallocate statement\n ");
76+ mmerror(PARSE_ERROR, ET_ERROR, "AT optionnot allowed in DEALLOCATE statement");
7777fprintf(yyout,"ECPGdeallocate_desc(__LINE__, %s);",$1);
7878whenever_action(0);
7979free($1);
@@ -95,7 +95,7 @@ ECPG: stmtViewStmt rule
9595| ECPGDisconnect
9696{
9797if (connection)
98- mmerror(PARSE_ERROR, ET_ERROR, "no at optionfor disconnect statement\n ");
98+ mmerror(PARSE_ERROR, ET_ERROR, "AT optionnot allowed in DISCONNECT statement");
9999
100100fprintf(yyout, "{ ECPGdisconnect(__LINE__, %s);",
101101$1 ? $1 : "\"CURRENT\"");
@@ -147,7 +147,7 @@ ECPG: stmtViewStmt rule
147147| ECPGSetConnection
148148{
149149if (connection)
150- mmerror(PARSE_ERROR, ET_ERROR, "no at optionfor set connection statement\n ");
150+ mmerror(PARSE_ERROR, ET_ERROR, "AT optionnot allowed in SET CONNECTION statement");
151151
152152fprintf(yyout, "{ ECPGsetconn(__LINE__, %s);", $1);
153153whenever_action(2);
@@ -169,7 +169,7 @@ ECPG: stmtViewStmt rule
169169| ECPGTypedef
170170{
171171if (connection)
172- mmerror(PARSE_ERROR, ET_ERROR, "no at optionfor typedef statement\n ");
172+ mmerror(PARSE_ERROR, ET_ERROR, "AT optionnot allowed in TYPE statement");
173173
174174fprintf(yyout, "%s", $1);
175175free($1);
@@ -178,33 +178,33 @@ ECPG: stmtViewStmt rule
178178| ECPGVar
179179{
180180if (connection)
181- mmerror(PARSE_ERROR, ET_ERROR, "no at optionfor var statement\n ");
181+ mmerror(PARSE_ERROR, ET_ERROR, "AT optionnot allowed in VAR statement");
182182
183183output_simple_statement($1);
184184}
185185| ECPGWhenever
186186{
187187if (connection)
188- mmerror(PARSE_ERROR, ET_ERROR, "no at optionfor whenever statement\n ");
188+ mmerror(PARSE_ERROR, ET_ERROR, "AT optionnot allowed in WHENEVER statement");
189189
190190output_simple_statement($1);
191191}
192192ECPG: CopyStmtCOPYopt_binaryqualified_nameopt_column_listopt_oidscopy_fromcopy_file_namecopy_delimiteropt_withcopy_opt_list addon
193193if (strcmp($6, "to") == 0 && strcmp($7, "stdin") == 0)
194- mmerror(PARSE_ERROR, ET_ERROR, "copy to stdin not possible\n ");
194+ mmerror(PARSE_ERROR, ET_ERROR, "COPY TO STDIN is not possible");
195195else if (strcmp($6, "from") == 0 && strcmp($7, "stdout") == 0)
196- mmerror(PARSE_ERROR, ET_ERROR, "copy from stdout not possible\n ");
196+ mmerror(PARSE_ERROR, ET_ERROR, "COPY FROM STDOUT is not possible");
197197else if (strcmp($6, "from") == 0 && strcmp($7, "stdin") == 0)
198- mmerror(PARSE_ERROR, ET_WARNING, "copy from stdin not implemented\n ");
198+ mmerror(PARSE_ERROR, ET_WARNING, "COPY FROM STDIN is not implemented");
199199ECPG: CopyStmtCOPYselect_with_parensTOcopy_file_nameopt_withcopy_opt_list addon
200200if (strcmp($4, "stdin") == 0)
201- mmerror(PARSE_ERROR, ET_ERROR, "copy to stdin not possible\n ");
201+ mmerror(PARSE_ERROR, ET_ERROR, "COPY TO STDIN is not possible");
202202ECPG: ConstraintAttributeSpecConstraintDeferrabilitySpecConstraintTimeSpec addon
203203if (strcmp($1, "deferrable") != 0 && strcmp($2, "initially deferrable") == 0 )
204- mmerror(PARSE_ERROR, ET_ERROR, "INITIALLY DEFERREDconstraint must be DEFERRABLE\n ");
204+ mmerror(PARSE_ERROR, ET_ERROR, "constraint declared INITIALLY DEFERRED must be DEFERRABLE");
205205ECPG: ConstraintAttributeSpecConstraintTimeSpecConstraintDeferrabilitySpec addon
206206if (strcmp($2, "deferrable") != 0 && strcmp($1, "initially deferrable") == 0 )
207- mmerror(PARSE_ERROR, ET_ERROR, "INITIALLY DEFERREDconstraint must be DEFERRABLE\n ");
207+ mmerror(PARSE_ERROR, ET_ERROR, "constraint declared INITIALLY DEFERRED must be DEFERRABLE");
208208ECPG: var_valueNumericOnly addon
209209ECPG: fetch_directionSignedIconst addon
210210if ($1[0] == '$')
@@ -242,7 +242,7 @@ ECPG: DeclareCursorStmtDECLAREnamecursor_optionsCURSORopt_holdFORSelectStmt bloc
242242for (ptr = cur; ptr != NULL; ptr = ptr->next)
243243{
244244if (strcmp($2, ptr->name) == 0)
245- mmerror(PARSE_ERROR, ET_ERROR, "cursor \"%s\" already defined\n ", $2);
245+ mmerror(PARSE_ERROR, ET_ERROR, "cursor \"%s\"is already defined", $2);
246246}
247247
248248this = (struct cursor *) mm_alloc(sizeof(struct cursor));
@@ -276,7 +276,7 @@ ECPG: into_clauseINTOOptTempTableName block
276276}
277277| ecpg_into { $$ = EMPTY; }
278278ECPG: table_refselect_with_parens addon
279- mmerror(PARSE_ERROR, ET_ERROR, "sub-SELECT in FROM must have an alias\n ");
279+ mmerror(PARSE_ERROR, ET_ERROR, "subquery in FROM must have an alias");
280280ECPG: TypenameSimpleTypenameopt_array_bounds block
281281{$$ = cat2_str($1, $2.str); }
282282ECPG: TypenameSETOFSimpleTypenameopt_array_bounds block
@@ -323,7 +323,7 @@ ECPG: type_function_nametype_func_name_keyword rule
323323| ECPGCKeywords { $$ = $1; }
324324ECPG: VariableShowStmtSHOWALL block
325325{
326- mmerror(PARSE_ERROR, ET_ERROR, "SHOW ALL not implemented\n ");
326+ mmerror(PARSE_ERROR, ET_ERROR, "SHOW ALLis not implemented");
327327$$ = EMPTY;
328328}
329329ECPG: FetchStmtFETCHfetch_directionfrom_inname block
@@ -369,13 +369,13 @@ ECPG: FetchStmtMOVEname rule
369369}
370370ECPG: SpecialRuleRelationOLD addon
371371if (!QueryIsRule)
372- mmerror(PARSE_ERROR, ET_ERROR, "OLD used innon-rule query\n ");
372+ mmerror(PARSE_ERROR, ET_ERROR, "OLD used ina query that is not in a rule ");
373373ECPG: SpecialRuleRelationNEW addon
374374if (!QueryIsRule)
375- mmerror(PARSE_ERROR, ET_ERROR, "NEW used innon-rule query\n ");
375+ mmerror(PARSE_ERROR, ET_ERROR, "NEW used ina query that is not in a rule ");
376376ECPG: select_limitLIMITselect_limit_value','select_offset_value block
377377 {
378- mmerror(PARSE_ERROR, ET_WARNING, "no longer supported LIMIT #,# syntax passed tobackend ");
378+ mmerror(PARSE_ERROR, ET_WARNING, "no longer supported LIMIT #,# syntax passed toserver ");
379379 $$ = cat_str(4, make_str("limit"), $2, make_str(","), $4);
380380 }
381381ECPG: SignedIconstIconst rule