Some "feature not supported" errors are better syntax errors, because the
feature they complain about isn't a feature or cannot be implemented without definitional changes.
This commit is contained in:
parent
3610f083c1
commit
33d4c828fd
|
@ -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:
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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")));
|
||||
|
||||
/*
|
||||
|
|
|
@ -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.")));
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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")));
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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")));
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue