From 2d13472c9e708ec3ed1b5c8fcb763a0ba22afd1e Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Mon, 15 Sep 2003 20:03:37 +0000 Subject: [PATCH] OK, some of these syntax errors should be given other codes. --- src/backend/executor/execQual.c | 10 +++++----- src/backend/executor/functions.c | 6 +++--- src/backend/utils/adt/acl.c | 8 ++++---- src/backend/utils/adt/array_userfuncs.c | 4 ++-- src/backend/utils/adt/pgstatfuncs.c | 2 +- src/backend/utils/adt/ruleutils.c | 7 ++----- src/backend/utils/adt/sets.c | 4 ++-- src/backend/utils/adt/varbit.c | 8 ++++---- src/backend/utils/fmgr/funcapi.c | 4 ++-- 9 files changed, 25 insertions(+), 28 deletions(-) diff --git a/src/backend/executor/execQual.c b/src/backend/executor/execQual.c index 9c0ba76ecd..c99d2e095d 100644 --- a/src/backend/executor/execQual.c +++ b/src/backend/executor/execQual.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.143 2003/09/09 23:22:20 petere Exp $ + * $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.144 2003/09/15 20:03:37 petere Exp $ * *------------------------------------------------------------------------- */ @@ -713,7 +713,7 @@ ExecMakeFunctionResult(FuncExprState *fcache, *isDone = ExprEndResult; else ereport(ERROR, - (errcode(ERRCODE_SYNTAX_ERROR), + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("set-valued function called in context that cannot accept a set"))); return (Datum) 0; } @@ -757,7 +757,7 @@ ExecMakeFunctionResult(FuncExprState *fcache, */ if (isDone == NULL) ereport(ERROR, - (errcode(ERRCODE_SYNTAX_ERROR), + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("set-valued function called in context that cannot accept a set"))); /* @@ -944,7 +944,7 @@ ExecMakeTableFunctionResult(ExprState *funcexpr, /* We don't allow sets in the arguments of the table function */ if (argDone != ExprSingleResult) ereport(ERROR, - (errcode(ERRCODE_SYNTAX_ERROR), + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("set-valued function called in context that cannot accept a set"))); /* @@ -2955,7 +2955,7 @@ ExecTargetList(List *targetlist, /* We have a set-valued expression in the tlist */ if (isDone == NULL) ereport(ERROR, - (errcode(ERRCODE_SYNTAX_ERROR), + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("set-valued function called in context that cannot accept a set"))); if (itemIsDone[resind] == ExprMultipleResult) { diff --git a/src/backend/executor/functions.c b/src/backend/executor/functions.c index d816b5d64a..3c1ece3ed4 100644 --- a/src/backend/executor/functions.c +++ b/src/backend/executor/functions.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/executor/functions.c,v 1.72 2003/09/09 23:22:20 petere Exp $ + * $Header: /cvsroot/pgsql/src/backend/executor/functions.c,v 1.73 2003/09/15 20:03:37 petere Exp $ * *------------------------------------------------------------------------- */ @@ -574,7 +574,7 @@ fmgr_sql(PG_FUNCTION_ARGS) rsi->isDone = ExprEndResult; else ereport(ERROR, - (errcode(ERRCODE_SYNTAX_ERROR), + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("set-valued function called in context that cannot accept a set"))); fcinfo->isnull = true; result = (Datum) 0; @@ -613,7 +613,7 @@ fmgr_sql(PG_FUNCTION_ARGS) rsi->isDone = ExprMultipleResult; else ereport(ERROR, - (errcode(ERRCODE_SYNTAX_ERROR), + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("set-valued function called in context that cannot accept a set"))); /* diff --git a/src/backend/utils/adt/acl.c b/src/backend/utils/adt/acl.c index 8d3b582fe2..05cc2ec8b6 100644 --- a/src/backend/utils/adt/acl.c +++ b/src/backend/utils/adt/acl.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/acl.c,v 1.97 2003/09/09 23:22:21 petere Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/acl.c,v 1.98 2003/09/15 20:03:37 petere Exp $ * *------------------------------------------------------------------------- */ @@ -776,8 +776,8 @@ aclremove(PG_FUNCTION_ARGS) if (dst == 0) { /* start */ ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot remove the world ACL"))); + (errcode(ERRCODE_DATA_EXCEPTION), + errmsg("aclitem for public may not be removed"))); } else if (dst == old_num - 1) { /* end */ @@ -846,7 +846,7 @@ makeaclitem(PG_FUNCTION_ARGS) else if (u_grantee != 0 && g_grantee != 0) { ereport(ERROR, - (errcode(ERRCODE_SYNTAX_ERROR), + (errcode(ERRCODE_DATA_EXCEPTION), errmsg("cannot specify both user and group"))); } else if (u_grantee != 0) diff --git a/src/backend/utils/adt/array_userfuncs.c b/src/backend/utils/adt/array_userfuncs.c index e0f58fb070..31e11aedb3 100644 --- a/src/backend/utils/adt/array_userfuncs.c +++ b/src/backend/utils/adt/array_userfuncs.c @@ -6,7 +6,7 @@ * Copyright (c) 2003, PostgreSQL Global Development Group * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/array_userfuncs.c,v 1.9 2003/09/09 23:22:21 petere Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/array_userfuncs.c,v 1.10 2003/09/15 20:03:37 petere Exp $ * *------------------------------------------------------------------------- */ @@ -95,7 +95,7 @@ array_push(PG_FUNCTION_ARGS) indx = 1; else ereport(ERROR, - (errcode(ERRCODE_SYNTAX_ERROR), + (errcode(ERRCODE_DATA_EXCEPTION), errmsg("argument must be empty or one-dimensional array"))); /* diff --git a/src/backend/utils/adt/pgstatfuncs.c b/src/backend/utils/adt/pgstatfuncs.c index 240c36ea7c..440783764a 100644 --- a/src/backend/utils/adt/pgstatfuncs.c +++ b/src/backend/utils/adt/pgstatfuncs.c @@ -187,7 +187,7 @@ pg_stat_get_backend_idset(PG_FUNCTION_ARGS) if (fcinfo->resultinfo == NULL || !IsA(fcinfo->resultinfo, ReturnSetInfo)) ereport(ERROR, - (errcode(ERRCODE_SYNTAX_ERROR), + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("set-valued function called in context that " "cannot accept a set"))); diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c index 0d40c070f9..d362940dc7 100644 --- a/src/backend/utils/adt/ruleutils.c +++ b/src/backend/utils/adt/ruleutils.c @@ -3,7 +3,7 @@ * back to source text * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.153 2003/09/09 23:22:21 petere Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.154 2003/09/15 20:03:37 petere Exp $ * * This software is copyrighted by Jan Wieck - Hamburg. * @@ -1097,10 +1097,7 @@ pg_get_constraintdef_worker(Oid constraintId, int prettyFlags) break; } default: - ereport(ERROR, - (errcode(ERRCODE_INTERNAL_ERROR), - errmsg("invalid constraint type \"%c\"", - conForm->contype))); + elog(ERROR, "invalid constraint type \"%c\"", conForm->contype); break; } diff --git a/src/backend/utils/adt/sets.c b/src/backend/utils/adt/sets.c index ccd6b2e796..63683e75f3 100644 --- a/src/backend/utils/adt/sets.c +++ b/src/backend/utils/adt/sets.c @@ -10,7 +10,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/sets.c,v 1.59 2003/09/09 23:22:21 petere Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/sets.c,v 1.60 2003/09/15 20:03:37 petere Exp $ * *------------------------------------------------------------------------- */ @@ -203,7 +203,7 @@ seteval(PG_FUNCTION_ARGS) rsi->isDone = isDone; else ereport(ERROR, - (errcode(ERRCODE_SYNTAX_ERROR), + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("set-valued function called in context that " "cannot accept a set"))); } diff --git a/src/backend/utils/adt/varbit.c b/src/backend/utils/adt/varbit.c index 0c5ee10d1b..f870fcc1ee 100644 --- a/src/backend/utils/adt/varbit.c +++ b/src/backend/utils/adt/varbit.c @@ -9,7 +9,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/varbit.c,v 1.35 2003/09/09 23:22:21 petere Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/varbit.c,v 1.36 2003/09/15 20:03:37 petere Exp $ * *------------------------------------------------------------------------- */ @@ -901,7 +901,7 @@ bitand(PG_FUNCTION_ARGS) bitlen2 = VARBITLEN(arg2); if (bitlen1 != bitlen2) ereport(ERROR, - (errcode(ERRCODE_SYNTAX_ERROR), + (errcode(ERRCODE_STRING_DATA_LENGTH_MISMATCH), errmsg("cannot AND bit strings of different sizes"))); len = VARSIZE(arg1); @@ -942,7 +942,7 @@ bitor(PG_FUNCTION_ARGS) bitlen2 = VARBITLEN(arg2); if (bitlen1 != bitlen2) ereport(ERROR, - (errcode(ERRCODE_SYNTAX_ERROR), + (errcode(ERRCODE_STRING_DATA_LENGTH_MISMATCH), errmsg("cannot OR bit strings of different sizes"))); len = VARSIZE(arg1); result = (VarBit *) palloc(len); @@ -988,7 +988,7 @@ bitxor(PG_FUNCTION_ARGS) bitlen2 = VARBITLEN(arg2); if (bitlen1 != bitlen2) ereport(ERROR, - (errcode(ERRCODE_SYNTAX_ERROR), + (errcode(ERRCODE_STRING_DATA_LENGTH_MISMATCH), errmsg("cannot XOR bit strings of different sizes"))); len = VARSIZE(arg1); diff --git a/src/backend/utils/fmgr/funcapi.c b/src/backend/utils/fmgr/funcapi.c index b72346f5db..53b8cc3a23 100644 --- a/src/backend/utils/fmgr/funcapi.c +++ b/src/backend/utils/fmgr/funcapi.c @@ -7,7 +7,7 @@ * Copyright (c) 2002-2003, PostgreSQL Global Development Group * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/fmgr/funcapi.c,v 1.10 2003/09/09 23:22:21 petere Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/fmgr/funcapi.c,v 1.11 2003/09/15 20:03:37 petere Exp $ * *------------------------------------------------------------------------- */ @@ -34,7 +34,7 @@ init_MultiFuncCall(PG_FUNCTION_ARGS) */ if (fcinfo->resultinfo == NULL || !IsA(fcinfo->resultinfo, ReturnSetInfo)) ereport(ERROR, - (errcode(ERRCODE_SYNTAX_ERROR), + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("set-valued function called in context that cannot accept a set"))); if (fcinfo->flinfo->fn_extra == NULL)