]> granicus.if.org Git - postgresql/commitdiff
OK, some of these syntax errors should be given other codes.
authorPeter Eisentraut <peter_e@gmx.net>
Mon, 15 Sep 2003 20:03:37 +0000 (20:03 +0000)
committerPeter Eisentraut <peter_e@gmx.net>
Mon, 15 Sep 2003 20:03:37 +0000 (20:03 +0000)
src/backend/executor/execQual.c
src/backend/executor/functions.c
src/backend/utils/adt/acl.c
src/backend/utils/adt/array_userfuncs.c
src/backend/utils/adt/pgstatfuncs.c
src/backend/utils/adt/ruleutils.c
src/backend/utils/adt/sets.c
src/backend/utils/adt/varbit.c
src/backend/utils/fmgr/funcapi.c

index 9c0ba76ecd997e74839247664d8ae11cadabb12a..c99d2e095d7b5c09557a443823c9844a8ba783d7 100644 (file)
@@ -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)
                        {
index d816b5d64a0db0ce3102979cc6888bbb6459a4cb..3c1ece3ed43c7a2c5f43a8b6faae3a8c34b783dd 100644 (file)
@@ -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")));
 
                /*
index 8d3b582fe29e5b0188d2da75a41b2c7ea32466cb..05cc2ec8b6a74f1d4396f867fb63bc24ccd57f02 100644 (file)
@@ -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)
index e0f58fb0705c34ce0d2f2ba660f7fd965be4485f..31e11aedb37e3b1c4f572cea7249b4e2450d72bf 100644 (file)
@@ -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")));
 
        /*
index 240c36ea7c0725c723451a6c5b341d389a6f1780..440783764ae2969eb8d28e59cd5670d9ac3b6676 100644 (file)
@@ -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")));
 
index 0d40c070f95f5b0c00230d4cd34fb51a8b56c202..d362940dc756982e0c03805b962fac62bebd95c4 100644 (file)
@@ -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;
        }
 
index ccd6b2e796740fe4302d26721d3fab656db62204..63683e75f3b352c7f633e69db7009fef4ddb8dd9 100644 (file)
@@ -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")));
        }
index 0c5ee10d1bf833b6ce6db079eeb083a78db920bd..f870fcc1ee609574b5a8282a1e61840c39047e74 100644 (file)
@@ -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);
index b72346f5dbf8f1b6fd8ff517fc1f2d7b009779fd..53b8cc3a2370da87706dc5f9b0acc39f68e9b9d5 100644 (file)
@@ -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)