* procedural language
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.88 2003/07/25 23:37:28 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.89 2003/07/27 18:38:26 tgl Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
/*
* Make local execution copies of all the datums
*/
- estate.err_text = "while initialization of execution state";
+ estate.err_text = gettext_noop("during initialization of execution state");
for (i = 0; i < func->ndatums; i++)
{
switch (func->datums[i]->dtype)
}
/*
- * Put the actual call argument values into the variables
+ * Store the actual call argument values into the variables
*/
- estate.err_text = "while putting call arguments to local variables";
+ estate.err_text = gettext_noop("while storing call arguments into local variables");
for (i = 0; i < func->fn_nargs; i++)
{
int n = func->fn_argvarnos[i];
* Initialize the other variables to NULL values for now. The default
* values are set when the blocks are entered.
*/
- estate.err_text = "while initializing local variables to NULL";
+ estate.err_text = gettext_noop("while initializing local variables to NULL");
for (i = estate.found_varno; i < estate.ndatums; i++)
{
switch (estate.datums[i]->dtype)
if (exec_stmt_block(&estate, func->action) != PLPGSQL_RC_RETURN)
{
estate.err_stmt = NULL;
- estate.err_text = "at END of toplevel PL block";
+ estate.err_text = NULL;
ereport(ERROR,
(errcode(ERRCODE_S_R_E_FUNCTION_EXECUTED_NO_RETURN_STATEMENT),
errmsg("control reached end of function without RETURN")));
* We got a return value - process it
*/
estate.err_stmt = NULL;
- estate.err_text = "while casting return value to function's return type";
+ estate.err_text = gettext_noop("while casting return value to function's return type");
fcinfo->isnull = estate.retisnull;
/*
* Make local execution copies of all the datums
*/
- estate.err_text = "while initialization of execution state";
+ estate.err_text = gettext_noop("during initialization of execution state");
for (i = 0; i < func->ndatums; i++)
{
switch (func->datums[i]->dtype)
var->value = Int16GetDatum(trigdata->tg_trigger->tgnargs);
/*
- * Put the actual call argument values into the special execution
+ * Store the actual call argument values into the special execution
* state variables
*/
- estate.err_text = "while putting call arguments to local variables";
+ estate.err_text = gettext_noop("while storing call arguments into local variables");
estate.trig_nargs = trigdata->tg_trigger->tgnargs;
if (estate.trig_nargs == 0)
estate.trig_argv = NULL;
* Initialize the other variables to NULL values for now. The default
* values are set when the blocks are entered.
*/
- estate.err_text = "while initializing local variables to NULL";
+ estate.err_text = gettext_noop("while initializing local variables to NULL");
for (i = estate.found_varno; i < estate.ndatums; i++)
{
switch (estate.datums[i]->dtype)
if (exec_stmt_block(&estate, func->action) != PLPGSQL_RC_RETURN)
{
estate.err_stmt = NULL;
- estate.err_text = "at END of toplevel PL block";
+ estate.err_text = NULL;
ereport(ERROR,
(errcode(ERRCODE_S_R_E_FUNCTION_EXECUTED_NO_RETURN_STATEMENT),
errmsg("control reached end of trigger procedure without RETURN")));
return;
if (estate->err_stmt != NULL)
- errcontext("PL/pgSQL function %s line %d at %s",
+ {
+ /* translator: last %s is a plpgsql statement type name */
+ errcontext("PL/pgSQL function \"%s\" line %d at %s",
estate->err_func->fn_name,
estate->err_stmt->lineno,
plpgsql_stmt_typename(estate->err_stmt));
+ }
else if (estate->err_text != NULL)
- errcontext("PL/pgSQL function %s %s",
+ {
+ /*
+ * We don't expend the cycles to run gettext() on err_text unless
+ * we actually need it. Therefore, places that set up err_text should
+ * use gettext_noop() to ensure the strings get recorded in the
+ * message dictionary.
+ */
+ /* translator: last %s is a phrase such as "while storing call arguments into local variables" */
+ errcontext("PL/pgSQL function \"%s\" %s",
estate->err_func->fn_name,
- estate->err_text);
+ gettext(estate->err_text));
+ }
else
- errcontext("PL/pgSQL function %s",
+ errcontext("PL/pgSQL function \"%s\"",
estate->err_func->fn_name);
}
ERROR: duplicate key violates UNIQUE constraint "pfield_name"
update PSlot set backlink = 'WS.not.there' where slotname = 'PS.base.a1';
ERROR: WS.not.there does not exist
-CONTEXT: PL/pgSQL function tg_backlink_a line 16 at assignment
+CONTEXT: PL/pgSQL function "tg_backlink_a" line 16 at assignment
update PSlot set backlink = 'XX.illegal' where slotname = 'PS.base.a1';
ERROR: illegal backlink beginning with XX
-CONTEXT: PL/pgSQL function tg_backlink_a line 16 at assignment
+CONTEXT: PL/pgSQL function "tg_backlink_a" line 16 at assignment
update PSlot set slotlink = 'PS.not.there' where slotname = 'PS.base.a1';
ERROR: PS.not.there does not exist
-CONTEXT: PL/pgSQL function tg_slotlink_a line 16 at assignment
+CONTEXT: PL/pgSQL function "tg_slotlink_a" line 16 at assignment
update PSlot set slotlink = 'XX.illegal' where slotname = 'PS.base.a1';
ERROR: illegal slotlink beginning with XX
-CONTEXT: PL/pgSQL function tg_slotlink_a line 16 at assignment
+CONTEXT: PL/pgSQL function "tg_slotlink_a" line 16 at assignment
insert into HSlot values ('HS', 'base.hub1', 1, '');
ERROR: duplicate key violates UNIQUE constraint "hslot_name"
insert into HSlot values ('HS', 'base.hub1', 20, '');