]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Some "feature not supported" errors are better syntax errors, because the
authorPeter Eisentraut <peter_e@gmx.net>
Tue, 9 Sep 2003 23:22:21 +0000 (23:22 +0000)
committerPeter Eisentraut <peter_e@gmx.net>
Tue, 9 Sep 2003 23:22:21 +0000 (23:22 +0000)
feature they complain about isn't a feature or cannot be implemented without
definitional changes.

13 files changed:
src/backend/commands/typecmds.c
src/backend/executor/execQual.c
src/backend/executor/functions.c
src/backend/parser/gram.y
src/backend/tcop/utility.c
src/backend/utils/adt/acl.c
src/backend/utils/adt/array_userfuncs.c
src/backend/utils/adt/pgstatfuncs.c
src/backend/utils/adt/ri_triggers.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 bb339cfb770b5a805817a82c900665967191b611..53dffdab10104bbd01dcdf04cfa22d2d9b3471e6 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/commands/typecmds.c,v 1.43 2003/08/08 21:41:32 momjian Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/commands/typecmds.c,v 1.44 2003/09/09 23:22:19 petere Exp $
  *
  * DESCRIPTION
  *       The "DefineFoo" routines take the parse tree and pick out the
@@ -594,8 +594,8 @@ DefineDomain(CreateDomainStmt *stmt)
                /* Check for unsupported constraint types */
                if (IsA(newConstraint, FkConstraint))
                        ereport(ERROR,
-                                       (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-                       errmsg("FOREIGN KEY constraints not supported for domains")));
+                                       (errcode(ERRCODE_SYNTAX_ERROR),
+                       errmsg("foreign key constraints not possible for domains")));
 
                /* otherwise it should be a plain Constraint */
                if (!IsA(newConstraint, Constraint))
@@ -672,14 +672,14 @@ DefineDomain(CreateDomainStmt *stmt)
                                 */
                        case CONSTR_UNIQUE:
                                ereport(ERROR,
-                                               (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-                               errmsg("UNIQUE constraints not supported for domains")));
+                                               (errcode(ERRCODE_SYNTAX_ERROR),
+                               errmsg("unique constraints not possible for domains")));
                                break;
 
                        case CONSTR_PRIMARY:
                                ereport(ERROR,
-                                               (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-                                                errmsg("PRIMARY KEY constraints not supported for domains")));
+                                               (errcode(ERRCODE_SYNTAX_ERROR),
+                                                errmsg("primary key constraints not possible for domains")));
                                break;
 
                        case CONSTR_ATTR_DEFERRABLE:
@@ -688,7 +688,7 @@ DefineDomain(CreateDomainStmt *stmt)
                        case CONSTR_ATTR_IMMEDIATE:
                                ereport(ERROR,
                                                (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-                                                errmsg("deferrability constraints not supported for domains")));
+                                                errmsg("specifying constraint deferrability not supported for domains")));
                                break;
 
                        default:
@@ -1453,8 +1453,8 @@ AlterDomainAddConstraint(List *names, Node *newConstraint)
        /* Check for unsupported constraint types */
        if (IsA(newConstraint, FkConstraint))
                ereport(ERROR,
-                               (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-                  errmsg("FOREIGN KEY constraints not supported for domains")));
+                               (errcode(ERRCODE_SYNTAX_ERROR),
+                  errmsg("foreign key constraints not possible for domains")));
 
        /* otherwise it should be a plain Constraint */
        if (!IsA(newConstraint, Constraint))
@@ -1465,33 +1465,20 @@ AlterDomainAddConstraint(List *names, Node *newConstraint)
 
        switch (constr->contype)
        {
-               case CONSTR_DEFAULT:
-                       ereport(ERROR,
-                                       (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-                                        errmsg("use ALTER DOMAIN .. SET DEFAULT instead")));
-                       break;
-
-               case CONSTR_NOTNULL:
-               case CONSTR_NULL:
-                       ereport(ERROR,
-                                       (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-                                        errmsg("use ALTER DOMAIN .. [ SET | DROP ] NOT NULL instead")));
-                       break;
-
                case CONSTR_CHECK:
                        /* processed below */
                        break;
 
                case CONSTR_UNIQUE:
                        ereport(ERROR,
-                                       (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-                               errmsg("UNIQUE constraints not supported for domains")));
+                                       (errcode(ERRCODE_SYNTAX_ERROR),
+                                        errmsg("unique constraints not possible for domains")));
                        break;
 
                case CONSTR_PRIMARY:
                        ereport(ERROR,
-                                       (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-                       errmsg("PRIMARY KEY constraints not supported for domains")));
+                                       (errcode(ERRCODE_SYNTAX_ERROR),
+                                        errmsg("primary key constraints not possible for domains")));
                        break;
 
                case CONSTR_ATTR_DEFERRABLE:
@@ -1500,7 +1487,7 @@ AlterDomainAddConstraint(List *names, Node *newConstraint)
                case CONSTR_ATTR_IMMEDIATE:
                        ereport(ERROR,
                                        (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-                                        errmsg("deferrability constraints not supported for domains")));
+                                        errmsg("specifying constraint deferrability not supported for domains")));
                        break;
 
                default:
index d05eedceecf01aa51612c02c911c103bf705cdb5..9c0ba76ecd997e74839247664d8ae11cadabb12a 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.142 2003/08/17 23:43:25 tgl Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.143 2003/09/09 23:22:20 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -713,7 +713,7 @@ ExecMakeFunctionResult(FuncExprState *fcache,
                                *isDone = ExprEndResult;
                        else
                                ereport(ERROR,
-                                               (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+                                               (errcode(ERRCODE_SYNTAX_ERROR),
                                                 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_FEATURE_NOT_SUPPORTED),
+                                       (errcode(ERRCODE_SYNTAX_ERROR),
                                         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_FEATURE_NOT_SUPPORTED),
+                                       (errcode(ERRCODE_SYNTAX_ERROR),
                                         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_FEATURE_NOT_SUPPORTED),
+                                               (errcode(ERRCODE_SYNTAX_ERROR),
                                                 errmsg("set-valued function called in context that cannot accept a set")));
                        if (itemIsDone[resind] == ExprMultipleResult)
                        {
index a23eb9b107320ef9c9e187e41fc3a376cf092969..d816b5d64a0db0ce3102979cc6888bbb6459a4cb 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/executor/functions.c,v 1.71 2003/08/04 02:39:58 momjian Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/executor/functions.c,v 1.72 2003/09/09 23:22:20 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -574,7 +574,7 @@ fmgr_sql(PG_FUNCTION_ARGS)
                                rsi->isDone = ExprEndResult;
                        else
                                ereport(ERROR,
-                                               (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+                                               (errcode(ERRCODE_SYNTAX_ERROR),
                                                 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_FEATURE_NOT_SUPPORTED),
+                                       (errcode(ERRCODE_SYNTAX_ERROR),
                                         errmsg("set-valued function called in context that cannot accept a set")));
 
                /*
index 45671f1b7be034cc7b5a110912dff96838be9b36..1bda1431ad24fe7f098ed41a09fc583597c18b3a 100644 (file)
@@ -11,7 +11,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.431 2003/09/06 14:01:51 petere Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.432 2003/09/09 23:22:20 petere Exp $
  *
  * HISTORY
  *       AUTHOR                        DATE                    MAJOR EVENT
@@ -4610,7 +4610,7 @@ select_limit:
                                {
                                        /* Disabled because it was too confusing, bjm 2002-02-18 */
                                        ereport(ERROR,
-                                                       (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+                                                       (errcode(ERRCODE_SYNTAX_ERROR),
                                                         errmsg("LIMIT #,# syntax is not supported"),
                                                         errhint("Use separate LIMIT and OFFSET clauses.")));
                                }
index 2f6f541cef137f710af0d44b73384b51022a70cb..629751e2f15bf2c76a8d4a2020e8c6d4faca2b9c 100644 (file)
@@ -10,7 +10,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.205 2003/08/04 02:40:04 momjian Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.206 2003/09/09 23:22:21 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -630,7 +630,7 @@ ProcessUtility(Node *parsetree,
                                 */
                                switch (stmt->subtype)
                                {
-                                       case 'T':       /* ALTER COLUMN DEFAULT */
+                                       case 'T':       /* ALTER DOMAIN DEFAULT */
 
                                                /*
                                                 * Recursively alter column default for table and,
@@ -639,11 +639,11 @@ ProcessUtility(Node *parsetree,
                                                AlterDomainDefault(stmt->typename,
                                                                                   stmt->def);
                                                break;
-                                       case 'N':       /* ALTER COLUMN DROP NOT NULL */
+                                       case 'N':       /* ALTER DOMAIN DROP NOT NULL */
                                                AlterDomainNotNull(stmt->typename,
                                                                                   false);
                                                break;
-                                       case 'O':       /* ALTER COLUMN SET NOT NULL */
+                                       case 'O':       /* ALTER DOMAIN SET NOT NULL */
                                                AlterDomainNotNull(stmt->typename,
                                                                                   true);
                                                break;
index 8d5a675006bbfc2fa60f42253e6984e74cd880e8..8d3b582fe29e5b0188d2da75a41b2c7ea32466cb 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/utils/adt/acl.c,v 1.96 2003/08/17 19:58:05 tgl Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/utils/adt/acl.c,v 1.97 2003/09/09 23:22:21 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -846,7 +846,7 @@ makeaclitem(PG_FUNCTION_ARGS)
        else if (u_grantee != 0 && g_grantee != 0)
        {
                ereport(ERROR,
-                               (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+                               (errcode(ERRCODE_SYNTAX_ERROR),
                                 errmsg("cannot specify both user and group")));
        }
        else if (u_grantee != 0)
index ced3233d21860d53bc0fe5478f5cc1efd776137a..e0f58fb0705c34ce0d2f2ba660f7fd965be4485f 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.8 2003/08/17 23:43:26 tgl Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/utils/adt/array_userfuncs.c,v 1.9 2003/09/09 23:22:21 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -95,8 +95,8 @@ array_push(PG_FUNCTION_ARGS)
                indx = 1;
        else
                ereport(ERROR,
-                               (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-                                errmsg("input must be empty or one-dimensional array")));
+                               (errcode(ERRCODE_SYNTAX_ERROR),
+                                errmsg("argument must be empty or one-dimensional array")));
 
        /*
         * We arrange to look up info about element type only once per series
index 440783764ae2969eb8d28e59cd5670d9ac3b6676..240c36ea7c0725c723451a6c5b341d389a6f1780 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_FEATURE_NOT_SUPPORTED),
+                               (errcode(ERRCODE_SYNTAX_ERROR),
                                 errmsg("set-valued function called in context that "
                                                "cannot accept a set")));
 
index 55a6944971e2bc1d5b30705e91a91ee12f9e481e..e66c42f99bd331451600a04fa527da36f7119d9d 100644 (file)
@@ -17,7 +17,7 @@
  *
  * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
  *
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/ri_triggers.c,v 1.55 2003/08/17 19:58:05 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/ri_triggers.c,v 1.56 2003/09/09 23:22:21 petere Exp $
  *
  * ----------
  */
@@ -3009,7 +3009,7 @@ ri_ReportViolation(RI_QueryKey *qkey, const char *constrname,
 
        if (spi_err)
                ereport(ERROR,
-                               (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+                               (errcode(ERRCODE_INTERNAL_ERROR),
                                 errmsg("referential integrity query on \"%s\" from constraint \"%s\" on \"%s\" gave unexpected result",
                                                RelationGetRelationName(pk_rel),
                                                constrname,
index 5504251bc471d9157cf43e8c3b0d6f7dfd73079a..0d40c070f95f5b0c00230d4cd34fb51a8b56c202 100644 (file)
@@ -3,7 +3,7 @@
  *                             back to source text
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.152 2003/08/17 19:58:05 tgl Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.153 2003/09/09 23:22:21 petere Exp $
  *
  *       This software is copyrighted by Jan Wieck - Hamburg.
  *
@@ -1098,8 +1098,8 @@ pg_get_constraintdef_worker(Oid constraintId, int prettyFlags)
                        }
                default:
                        ereport(ERROR,
-                                       (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-                                        errmsg("unsupported constraint type \"%c\"",
+                                       (errcode(ERRCODE_INTERNAL_ERROR),
+                                        errmsg("invalid constraint type \"%c\"",
                                                        conForm->contype)));
                        break;
        }
index 7f9e01ab54daa8c532aba0a94ea16ca5aa4bc8de..ccd6b2e796740fe4302d26721d3fab656db62204 100644 (file)
@@ -10,7 +10,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/sets.c,v 1.58 2003/08/04 02:40:05 momjian Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/sets.c,v 1.59 2003/09/09 23:22:21 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -203,7 +203,7 @@ seteval(PG_FUNCTION_ARGS)
                        rsi->isDone = isDone;
                else
                        ereport(ERROR,
-                                       (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+                                       (errcode(ERRCODE_SYNTAX_ERROR),
                                         errmsg("set-valued function called in context that "
                                                        "cannot accept a set")));
        }
index 891e88b57476cf18988c1a0612d27bcb8430894e..0c5ee10d1bf833b6ce6db079eeb083a78db920bd 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.34 2003/08/04 02:40:06 momjian Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/utils/adt/varbit.c,v 1.35 2003/09/09 23:22:21 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -901,7 +901,7 @@ bitand(PG_FUNCTION_ARGS)
        bitlen2 = VARBITLEN(arg2);
        if (bitlen1 != bitlen2)
                ereport(ERROR,
-                               (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+                               (errcode(ERRCODE_SYNTAX_ERROR),
                                 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_FEATURE_NOT_SUPPORTED),
+                               (errcode(ERRCODE_SYNTAX_ERROR),
                                 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_FEATURE_NOT_SUPPORTED),
+                               (errcode(ERRCODE_SYNTAX_ERROR),
                                 errmsg("cannot XOR bit strings of different sizes")));
 
        len = VARSIZE(arg1);
index d7776d2ed031ce78c22f341d6848e54f98fa26ab..b72346f5dbf8f1b6fd8ff517fc1f2d7b009779fd 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.9 2003/08/04 23:59:39 tgl Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/utils/fmgr/funcapi.c,v 1.10 2003/09/09 23:22:21 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -34,7 +34,7 @@ init_MultiFuncCall(PG_FUNCTION_ARGS)
         */
        if (fcinfo->resultinfo == NULL || !IsA(fcinfo->resultinfo, ReturnSetInfo))
                ereport(ERROR,
-                               (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+                               (errcode(ERRCODE_SYNTAX_ERROR),
                                 errmsg("set-valued function called in context that cannot accept a set")));
 
        if (fcinfo->flinfo->fn_extra == NULL)