From 216311d590de4638997eb391722f915026a29e88 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 18 Jul 2003 23:20:33 +0000 Subject: First bits of work on error message editing. --- src/backend/parser/analyze.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/backend/parser/analyze.c') diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c index ca7759cfc82..8298e3613bd 100644 --- a/src/backend/parser/analyze.c +++ b/src/backend/parser/analyze.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.279 2003/07/16 17:25:48 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.280 2003/07/18 23:20:32 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -3095,11 +3095,15 @@ check_parameter_resolution_walker(Node *node, if (paramno <= 0 || /* shouldn't happen, but... */ paramno > context->numParams) - elog(ERROR, "Parameter '$%d' is out of range", paramno); + ereport(ERROR, + (errcode(ERRCODE_UNDEFINED_PARAMETER), + errmsg("there is no parameter $%d", paramno))); if (param->paramtype != context->paramTypes[paramno-1]) - elog(ERROR, "Could not determine datatype of parameter $%d", - paramno); + ereport(ERROR, + (errcode(ERRCODE_AMBIGUOUS_PARAMETER), + errmsg("could not determine datatype of parameter $%d", + paramno))); } return false; } -- cgit v1.2.3