Skip to content

Commit 2d13472

Browse files
committed
OK, some of these syntax errors should be given other codes.
1 parent baba02a commit 2d13472

File tree

9 files changed

+25
-28
lines changed

9 files changed

+25
-28
lines changed

src/backend/executor/execQual.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.143 2003/09/09 23:22:20 petere Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.144 2003/09/15 20:03:37 petere Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -713,7 +713,7 @@ ExecMakeFunctionResult(FuncExprState *fcache,
713713
*isDone = ExprEndResult;
714714
else
715715
ereport(ERROR,
716-
(errcode(ERRCODE_SYNTAX_ERROR),
716+
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
717717
errmsg("set-valued function called in context that cannot accept a set")));
718718
return (Datum) 0;
719719
}
@@ -757,7 +757,7 @@ ExecMakeFunctionResult(FuncExprState *fcache,
757757
*/
758758
if (isDone == NULL)
759759
ereport(ERROR,
760-
(errcode(ERRCODE_SYNTAX_ERROR),
760+
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
761761
errmsg("set-valued function called in context that cannot accept a set")));
762762

763763
/*
@@ -944,7 +944,7 @@ ExecMakeTableFunctionResult(ExprState *funcexpr,
944944
/* We don't allow sets in the arguments of the table function */
945945
if (argDone != ExprSingleResult)
946946
ereport(ERROR,
947-
(errcode(ERRCODE_SYNTAX_ERROR),
947+
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
948948
errmsg("set-valued function called in context that cannot accept a set")));
949949

950950
/*
@@ -2955,7 +2955,7 @@ ExecTargetList(List *targetlist,
29552955
/* We have a set-valued expression in the tlist */
29562956
if (isDone == NULL)
29572957
ereport(ERROR,
2958-
(errcode(ERRCODE_SYNTAX_ERROR),
2958+
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
29592959
errmsg("set-valued function called in context that cannot accept a set")));
29602960
if (itemIsDone[resind] == ExprMultipleResult)
29612961
{

src/backend/executor/functions.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/executor/functions.c,v 1.72 2003/09/09 23:22:20 petere Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/executor/functions.c,v 1.73 2003/09/15 20:03:37 petere Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -574,7 +574,7 @@ fmgr_sql(PG_FUNCTION_ARGS)
574574
rsi->isDone = ExprEndResult;
575575
else
576576
ereport(ERROR,
577-
(errcode(ERRCODE_SYNTAX_ERROR),
577+
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
578578
errmsg("set-valued function called in context that cannot accept a set")));
579579
fcinfo->isnull = true;
580580
result = (Datum) 0;
@@ -613,7 +613,7 @@ fmgr_sql(PG_FUNCTION_ARGS)
613613
rsi->isDone = ExprMultipleResult;
614614
else
615615
ereport(ERROR,
616-
(errcode(ERRCODE_SYNTAX_ERROR),
616+
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
617617
errmsg("set-valued function called in context that cannot accept a set")));
618618

619619
/*

src/backend/utils/adt/acl.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/acl.c,v 1.97 2003/09/09 23:22:21 petere Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/acl.c,v 1.98 2003/09/15 20:03:37 petere Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -776,8 +776,8 @@ aclremove(PG_FUNCTION_ARGS)
776776
if (dst == 0)
777777
{ /* start */
778778
ereport(ERROR,
779-
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
780-
errmsg("cannot remove the world ACL")));
779+
(errcode(ERRCODE_DATA_EXCEPTION),
780+
errmsg("aclitem for public may not be removed")));
781781
}
782782
else if (dst == old_num - 1)
783783
{ /* end */
@@ -846,7 +846,7 @@ makeaclitem(PG_FUNCTION_ARGS)
846846
else if (u_grantee != 0 && g_grantee != 0)
847847
{
848848
ereport(ERROR,
849-
(errcode(ERRCODE_SYNTAX_ERROR),
849+
(errcode(ERRCODE_DATA_EXCEPTION),
850850
errmsg("cannot specify both user and group")));
851851
}
852852
else if (u_grantee != 0)

src/backend/utils/adt/array_userfuncs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Copyright (c) 2003, PostgreSQL Global Development Group
77
*
88
* IDENTIFICATION
9-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/array_userfuncs.c,v 1.9 2003/09/09 23:22:21 petere Exp $
9+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/array_userfuncs.c,v 1.10 2003/09/15 20:03:37 petere Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -95,7 +95,7 @@ array_push(PG_FUNCTION_ARGS)
9595
indx = 1;
9696
else
9797
ereport(ERROR,
98-
(errcode(ERRCODE_SYNTAX_ERROR),
98+
(errcode(ERRCODE_DATA_EXCEPTION),
9999
errmsg("argument must be empty or one-dimensional array")));
100100

101101
/*

src/backend/utils/adt/pgstatfuncs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ pg_stat_get_backend_idset(PG_FUNCTION_ARGS)
187187
if (fcinfo->resultinfo == NULL ||
188188
!IsA(fcinfo->resultinfo, ReturnSetInfo))
189189
ereport(ERROR,
190-
(errcode(ERRCODE_SYNTAX_ERROR),
190+
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
191191
errmsg("set-valued function called in context that "
192192
"cannot accept a set")));
193193

src/backend/utils/adt/ruleutils.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* back to source text
44
*
55
* IDENTIFICATION
6-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.153 2003/09/09 23:22:21 petere Exp $
6+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.154 2003/09/15 20:03:37 petere Exp $
77
*
88
* This software is copyrighted by Jan Wieck - Hamburg.
99
*
@@ -1097,10 +1097,7 @@ pg_get_constraintdef_worker(Oid constraintId, int prettyFlags)
10971097
break;
10981098
}
10991099
default:
1100-
ereport(ERROR,
1101-
(errcode(ERRCODE_INTERNAL_ERROR),
1102-
errmsg("invalid constraint type \"%c\"",
1103-
conForm->contype)));
1100+
elog(ERROR, "invalid constraint type \"%c\"", conForm->contype);
11041101
break;
11051102
}
11061103

src/backend/utils/adt/sets.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/sets.c,v 1.59 2003/09/09 23:22:21 petere Exp $
13+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/sets.c,v 1.60 2003/09/15 20:03:37 petere Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -203,7 +203,7 @@ seteval(PG_FUNCTION_ARGS)
203203
rsi->isDone = isDone;
204204
else
205205
ereport(ERROR,
206-
(errcode(ERRCODE_SYNTAX_ERROR),
206+
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
207207
errmsg("set-valued function called in context that "
208208
"cannot accept a set")));
209209
}

src/backend/utils/adt/varbit.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Portions Copyright (c) 1994, Regents of the University of California
1010
*
1111
* IDENTIFICATION
12-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varbit.c,v 1.35 2003/09/09 23:22:21 petere Exp $
12+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varbit.c,v 1.36 2003/09/15 20:03:37 petere Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -901,7 +901,7 @@ bitand(PG_FUNCTION_ARGS)
901901
bitlen2 = VARBITLEN(arg2);
902902
if (bitlen1 != bitlen2)
903903
ereport(ERROR,
904-
(errcode(ERRCODE_SYNTAX_ERROR),
904+
(errcode(ERRCODE_STRING_DATA_LENGTH_MISMATCH),
905905
errmsg("cannot AND bit strings of different sizes")));
906906

907907
len = VARSIZE(arg1);
@@ -942,7 +942,7 @@ bitor(PG_FUNCTION_ARGS)
942942
bitlen2 = VARBITLEN(arg2);
943943
if (bitlen1 != bitlen2)
944944
ereport(ERROR,
945-
(errcode(ERRCODE_SYNTAX_ERROR),
945+
(errcode(ERRCODE_STRING_DATA_LENGTH_MISMATCH),
946946
errmsg("cannot OR bit strings of different sizes")));
947947
len = VARSIZE(arg1);
948948
result = (VarBit *) palloc(len);
@@ -988,7 +988,7 @@ bitxor(PG_FUNCTION_ARGS)
988988
bitlen2 = VARBITLEN(arg2);
989989
if (bitlen1 != bitlen2)
990990
ereport(ERROR,
991-
(errcode(ERRCODE_SYNTAX_ERROR),
991+
(errcode(ERRCODE_STRING_DATA_LENGTH_MISMATCH),
992992
errmsg("cannot XOR bit strings of different sizes")));
993993

994994
len = VARSIZE(arg1);

src/backend/utils/fmgr/funcapi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Copyright (c) 2002-2003, PostgreSQL Global Development Group
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/utils/fmgr/funcapi.c,v 1.10 2003/09/09 23:22:21 petere Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/fmgr/funcapi.c,v 1.11 2003/09/15 20:03:37 petere Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -34,7 +34,7 @@ init_MultiFuncCall(PG_FUNCTION_ARGS)
3434
*/
3535
if (fcinfo->resultinfo == NULL || !IsA(fcinfo->resultinfo, ReturnSetInfo))
3636
ereport(ERROR,
37-
(errcode(ERRCODE_SYNTAX_ERROR),
37+
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
3838
errmsg("set-valued function called in context that cannot accept a set")));
3939

4040
if (fcinfo->flinfo->fn_extra == NULL)

0 commit comments

Comments
 (0)