if ($2.scalar && $2.row)
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
- errmsg("cursor FOR loop must have just one target variable")));
+ errmsg("cursor FOR loop must have only one target variable")));
/* create loop's private RECORD variable */
plpgsql_convert_ident($2.name, &varname, 1);
if ($2.scalar && $2.row)
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
- errmsg("integer FOR loop must have just one target variable")));
+ errmsg("integer FOR loop must have only one target variable")));
/* create loop's private variable */
plpgsql_convert_ident($2.name, &varname, 1);
(errcode(ERRCODE_SYNTAX_ERROR),
errmsg("syntax error at \"%s\"",
yytext),
- errdetail("Expected FOR to open a reference cursor.")));
+ errdetail("Expected \"FOR\", to open a reference cursor.")));
}
tok = yylex();
plpgsql_error_lineno = plpgsql_scanner_lineno();
ereport(ERROR,
(errcode(ERRCODE_DATATYPE_MISMATCH),
- errmsg("\"%s\" must be of type cursor or refcursor",
+ errmsg("variable \"%s\" must be of type cursor or refcursor",
((PLpgSQL_var *) yylval.scalar)->refname)));
}
$$ = (PLpgSQL_var *) yylval.scalar;
if (parenlevel != 0)
yyerror("mismatched parentheses");
else
- yyerror("incomplete datatype declaration");
+ yyerror("incomplete data type declaration");
}
/* Possible followers for datatype in a declaration */
if (tok == K_NOT || tok == K_ASSIGN || tok == K_DEFAULT)
type_name = plpgsql_dstring_get(&ds);
if (type_name[0] == '\0')
- yyerror("missing datatype declaration");
+ yyerror("missing data type declaration");
plpgsql_error_lineno = lno; /* in case of error in parse_datatype */
break;
default:
- yyerror("RETURN must specify a record or row variable in function returning tuple");
+ yyerror("RETURN must specify a record or row variable in function returning row");
break;
}
if (yylex() != ';')
- yyerror("RETURN must specify a record or row variable in function returning tuple");
+ yyerror("RETURN must specify a record or row variable in function returning row");
}
else
{
break;
default:
- yyerror("RETURN NEXT must specify a record or row variable in function returning tuple");
+ yyerror("RETURN NEXT must specify a record or row variable in function returning row");
break;
}
if (yylex() != ';')
- yyerror("RETURN NEXT must specify a record or row variable in function returning tuple");
+ yyerror("RETURN NEXT must specify a record or row variable in function returning row");
}
else
new->expr = plpgsql_read_expression(';', ";");
plpgsql_convert_ident(yytxt, &label_name, 1);
if (plpgsql_ns_lookup_label(label_name) == NULL)
- yyerror("no such label");
+ yyerror("label does not exist");
return label_name;
}
argdtype->ttype != PLPGSQL_TTYPE_ROW)
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("plpgsql functions cannot take type %s",
+ errmsg("PL/pgSQL functions cannot accept type %s",
format_type_be(argtypeid))));
/* Build variable and add to datum list */
else
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("plpgsql functions cannot return type %s",
+ errmsg("PL/pgSQL functions cannot return type %s",
format_type_be(rettypeid))));
}
ereport(ERROR,
(errcode(ERRCODE_INVALID_FUNCTION_DEFINITION),
errmsg("trigger functions cannot have declared arguments"),
- errhint("You probably want to use TG_NARGS and TG_ARGV instead.")));
+ errhint("The arguments of the trigger can be accessed through TG_NARGS and TG_ARGV instead.")));
/* Add the record for referencing NEW */
rec = plpgsql_build_record("new", 0, true);
}
if (plpgsql_error_funcname)
- errcontext("compile of PL/pgSQL function \"%s\" near line %d",
+ errcontext("compilation of PL/pgSQL function \"%s\" near line %d",
plpgsql_error_funcname, plpgsql_error_lineno);
}
{
validate_tupdesc_compat(trigdata->tg_relation->rd_att,
estate.rettupdesc,
- "returned tuple structure does not match table of trigger event");
+ "returned row structure does not match the structure of the triggering table");
/* Copy tuple to upper executor memory */
rettup = SPI_copytuple((HeapTuple) DatumGetPointer(estate.retval));
}
*/
if (estate->err_stmt != NULL)
{
- /*
- * translator: last %s is a phrase such as "during statement block
- * local variable initialization"
- */
+ /* translator: last %s is a phrase such as "during statement block local variable initialization" */
errcontext("PL/pgSQL function \"%s\" line %d %s",
estate->err_func->fn_name,
estate->err_stmt->lineno,
- gettext(estate->err_text));
+ _(estate->err_text));
}
else
{
- /*
- * translator: last %s is a phrase such as "while storing call
- * arguments into local variables"
- */
+ /* 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,
- gettext(estate->err_text));
+ _(estate->err_text));
}
}
else if (estate->err_stmt != NULL)
if (isnull)
ereport(ERROR,
(errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
- errmsg("lower bound of FOR loop cannot be NULL")));
+ errmsg("lower bound of FOR loop cannot be null")));
loop_value = DatumGetInt32(value);
exec_eval_cleanup(estate);
if (isnull)
ereport(ERROR,
(errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
- errmsg("upper bound of FOR loop cannot be NULL")));
+ errmsg("upper bound of FOR loop cannot be null")));
end_value = DatumGetInt32(value);
exec_eval_cleanup(estate);
if (isnull)
ereport(ERROR,
(errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
- errmsg("BY value of FOR loop cannot be NULL")));
+ errmsg("BY value of FOR loop cannot be null")));
step_value = DatumGetInt32(value);
exec_eval_cleanup(estate);
if (step_value <= 0)
if (optionisnull)
ereport(ERROR,
(errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
- errmsg("RAISE statement option cannot be NULL")));
+ errmsg("RAISE statement option cannot be null")));
extval = convert_value_to_string(optionvalue, optiontypeid);
if (isnull)
ereport(ERROR,
(errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
- errmsg("cannot EXECUTE a null querystring")));
+ errmsg("query string argument of EXECUTE is null")));
/* Get the C-String representation */
querystr = convert_value_to_string(query, restype);
if (*ptr == 'S' || *ptr == 's')
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("EXECUTE of SELECT ... INTO is not implemented yet")));
+ errmsg("EXECUTE of SELECT ... INTO is not implemented")));
break;
}
if (isnull)
ereport(ERROR,
(errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
- errmsg("cannot EXECUTE a null querystring")));
+ errmsg("query string argument of EXECUTE is null")));
/* Get the C-String representation */
querystr = convert_value_to_string(queryD, restype);
if (curvar->isnull)
ereport(ERROR,
(errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
- errmsg("cursor variable \"%s\" is NULL", curvar->refname)));
+ errmsg("cursor variable \"%s\" is null", curvar->refname)));
curname = TextDatumGetCString(curvar->value);
portal = SPI_cursor_find(curname);
if (isnull)
ereport(ERROR,
(errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
- errmsg("relative or absolute cursor position is NULL")));
+ errmsg("relative or absolute cursor position is null")));
exec_eval_cleanup(estate);
}
if (curvar->isnull)
ereport(ERROR,
(errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
- errmsg("cursor variable \"%s\" is NULL", curvar->refname)));
+ errmsg("cursor variable \"%s\" is null", curvar->refname)));
curname = TextDatumGetCString(curvar->value);
portal = SPI_cursor_find(curname);
if (*isNull && var->notnull)
ereport(ERROR,
(errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
- errmsg("NULL cannot be assigned to variable \"%s\" declared NOT NULL",
+ errmsg("null value cannot be assigned to variable \"%s\" declared NOT NULL",
var->refname)));
/*
if (nsubscripts >= MAXDIM)
ereport(ERROR,
(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
- errmsg("number of array dimensions exceeds the maximum allowed, %d",
- MAXDIM)));
+ errmsg("number of array dimensions (%d) exceeds the maximum allowed (%d)",
+ nsubscripts, MAXDIM)));
subscripts[nsubscripts++] = arrayelem->subscript;
target = estate->datums[arrayelem->arrayparentno];
} while (target->dtype == PLPGSQL_DTYPE_ARRAYELEM);
if (subisnull)
ereport(ERROR,
(errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
- errmsg("array subscript in assignment must not be NULL")));
+ errmsg("array subscript in assignment must not be null")));
}
/* Coerce source value to match array element type. */
validate_tupdesc_compat(TupleDesc expected, TupleDesc returned, const char *msg)
{
int i;
- const char *dropped_column_type = gettext_noop("n/a (dropped column)");
+ const char *dropped_column_type = gettext_noop("N/A (dropped column)");
if (!expected || !returned)
ereport(ERROR,
if (isnull)
ereport(ERROR,
(errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
- errmsg("cannot EXECUTE a null querystring")));
+ errmsg("query string argument of EXECUTE is null")));
/* Get the C-String representation */
querystr = convert_value_to_string(query, restype);
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
- errmsg("there is no variable \"%s\" in the current block",
+ errmsg("variable \"%s\" does not exist in the current block",
oldname)));
}
if (*s != '"') /* should not happen if lexer checked */
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
- errmsg("unterminated \" in name: %s", sstart)));
+ errmsg("unterminated \" in identifier: %s", sstart)));
s++;
*cp = '\0';
/* Truncate to NAMEDATALEN */
!IsPolymorphicType(proc->prorettype))
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("plpgsql functions cannot return type %s",
+ errmsg("PL/pgSQL functions cannot return type %s",
format_type_be(proc->prorettype))));
}
if (!IsPolymorphicType(argtypes[i]))
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("plpgsql functions cannot take type %s",
+ errmsg("PL/pgSQL functions cannot accept type %s",
format_type_be(argtypes[i]))));
}
}
plpgsql_error_lineno = start_lineno;
ereport(ERROR,
(errcode(ERRCODE_DATATYPE_MISMATCH),
- errmsg("unterminated comment")));
+ errmsg("unterminated /* comment")));
}
/* ----------
plpgsql_error_lineno = start_lineno;
ereport(ERROR,
(errcode(ERRCODE_DATATYPE_MISMATCH),
- errmsg("unterminated string")));
+ errmsg("unterminated quoted string")));
}
{dolqdelim} {
end loop flbl1;
end;
$$ language plpgsql;
-ERROR: no such label at or near "flbl1"
+ERROR: label does not exist at or near "flbl1"
LINE 5: end loop flbl1;
^
-- should fail: end label does not match start label
end;
$$ language plpgsql;
ERROR: end label "outer_label" differs from block's label "inner_label"
-CONTEXT: compile of PL/pgSQL function "end_label3" near line 6
+CONTEXT: compilation of PL/pgSQL function "end_label3" near line 6
-- should fail: end label on a block without a start label
create function end_label4() returns void as $$
<<outer_label>>
end;
$$ language plpgsql;
ERROR: end label "outer_label" specified for unlabelled block
-CONTEXT: compile of PL/pgSQL function "end_label4" near line 5
+CONTEXT: compilation of PL/pgSQL function "end_label4" near line 5
-- using list of scalars in fori and fore stmts
create function for_vect() returns void as $proc$
<<lbl>>declare a integer; b varchar; c varchar; r record;
end;
$$ language plpgsql;
ERROR: cursor FOR loop must use a bound cursor variable
-CONTEXT: compile of PL/pgSQL function "forc_bad" near line 4
+CONTEXT: compilation of PL/pgSQL function "forc_bad" near line 4
-- test RETURN QUERY EXECUTE
create or replace function return_dquery()
returns setof int as $$