Add new SQL:2008 error codes for invalid LIMIT and OFFSET values. Remove
unused nonstandard error code that was perhaps intended for this but never used.
This commit is contained in:
parent
9add9f95c3
commit
12f87b2c82
@ -1,4 +1,4 @@
|
||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/errcodes.sgml,v 1.26 2008/12/28 18:53:53 tgl Exp $ -->
|
||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/errcodes.sgml,v 1.27 2009/03/04 10:55:00 petere Exp $ -->
|
||||
|
||||
<appendix id="errcodes-appendix">
|
||||
<title><productname>PostgreSQL</productname> Error Codes</title>
|
||||
@ -444,12 +444,6 @@
|
||||
<entry>invalid_indicator_parameter_value</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><literal>22020</literal></entry>
|
||||
<entry>INVALID LIMIT VALUE</entry>
|
||||
<entry>invalid_limit_value</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><literal>22023</literal></entry>
|
||||
<entry>INVALID PARAMETER VALUE</entry>
|
||||
@ -462,6 +456,18 @@
|
||||
<entry>invalid_regular_expression</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><literal>2201W</literal></entry>
|
||||
<entry>INVALID ROW COUNT IN LIMIT CLAUSE</entry>
|
||||
<entry>invalid_row_count_in_limit_clause</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><literal>2201X</literal></entry>
|
||||
<entry>INVALID ROW COUNT IN RESULT OFFSET CLAUSE</entry>
|
||||
<entry>invalid_row_count_in_result_offset_clause</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><literal>22009</literal></entry>
|
||||
<entry>INVALID TIME ZONE DISPLACEMENT VALUE</entry>
|
||||
|
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/executor/nodeLimit.c,v 1.35 2009/01/01 17:23:41 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/executor/nodeLimit.c,v 1.36 2009/03/04 10:55:00 petere Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -247,7 +247,7 @@ recompute_limits(LimitState *node)
|
||||
node->offset = DatumGetInt64(val);
|
||||
if (node->offset < 0)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||
(errcode(ERRCODE_INVALID_ROW_COUNT_IN_RESULT_OFFSET_CLAUSE),
|
||||
errmsg("OFFSET must not be negative")));
|
||||
}
|
||||
}
|
||||
@ -274,7 +274,7 @@ recompute_limits(LimitState *node)
|
||||
node->count = DatumGetInt64(val);
|
||||
if (node->count < 0)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||
(errcode(ERRCODE_INVALID_ROW_COUNT_IN_LIMIT_CLAUSE),
|
||||
errmsg("LIMIT must not be negative")));
|
||||
node->noCount = false;
|
||||
}
|
||||
|
@ -11,7 +11,7 @@
|
||||
*
|
||||
* Copyright (c) 2003-2009, PostgreSQL Global Development Group
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/include/utils/errcodes.h,v 1.28 2009/01/01 17:24:02 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/include/utils/errcodes.h,v 1.29 2009/03/04 10:55:00 petere Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -133,9 +133,10 @@
|
||||
#define ERRCODE_INVALID_ESCAPE_SEQUENCE MAKE_SQLSTATE('2','2', '0','2','5')
|
||||
#define ERRCODE_NONSTANDARD_USE_OF_ESCAPE_CHARACTER MAKE_SQLSTATE('2','2', 'P','0','6')
|
||||
#define ERRCODE_INVALID_INDICATOR_PARAMETER_VALUE MAKE_SQLSTATE('2','2', '0','1','0')
|
||||
#define ERRCODE_INVALID_LIMIT_VALUE MAKE_SQLSTATE('2','2', '0','2','0')
|
||||
#define ERRCODE_INVALID_PARAMETER_VALUE MAKE_SQLSTATE('2','2', '0','2','3')
|
||||
#define ERRCODE_INVALID_REGULAR_EXPRESSION MAKE_SQLSTATE('2','2', '0','1','B')
|
||||
#define ERRCODE_INVALID_ROW_COUNT_IN_LIMIT_CLAUSE MAKE_SQLSTATE('2', '2', '0', '1', 'W')
|
||||
#define ERRCODE_INVALID_ROW_COUNT_IN_RESULT_OFFSET_CLAUSE MAKE_SQLSTATE('2', '2', '0', '1', 'X')
|
||||
#define ERRCODE_INVALID_TIME_ZONE_DISPLACEMENT_VALUE MAKE_SQLSTATE('2','2', '0','0','9')
|
||||
#define ERRCODE_INVALID_USE_OF_ESCAPE_CHARACTER MAKE_SQLSTATE('2','2', '0','0','C')
|
||||
#define ERRCODE_MOST_SPECIFIC_TYPE_MISMATCH MAKE_SQLSTATE('2','2', '0','0','G')
|
||||
|
@ -9,7 +9,7 @@
|
||||
*
|
||||
* Copyright (c) 2003-2009, PostgreSQL Global Development Group
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/pl/plpgsql/src/plerrcodes.h,v 1.17 2009/01/01 17:24:04 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/pl/plpgsql/src/plerrcodes.h,v 1.18 2009/03/04 10:55:00 petere Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -175,10 +175,6 @@
|
||||
"invalid_indicator_parameter_value", ERRCODE_INVALID_INDICATOR_PARAMETER_VALUE
|
||||
},
|
||||
|
||||
{
|
||||
"invalid_limit_value", ERRCODE_INVALID_LIMIT_VALUE
|
||||
},
|
||||
|
||||
{
|
||||
"invalid_parameter_value", ERRCODE_INVALID_PARAMETER_VALUE
|
||||
},
|
||||
@ -187,6 +183,14 @@
|
||||
"invalid_regular_expression", ERRCODE_INVALID_REGULAR_EXPRESSION
|
||||
},
|
||||
|
||||
{
|
||||
"invalid_row_count_in_limit_clause", ERRCODE_INVALID_ROW_COUNT_IN_LIMIT_CLAUSE
|
||||
},
|
||||
|
||||
{
|
||||
"invalid_row_count_in_result_offset_clause", ERRCODE_INVALID_ROW_COUNT_IN_RESULT_OFFSET_CLAUSE
|
||||
},
|
||||
|
||||
{
|
||||
"invalid_time_zone_displacement_value", ERRCODE_INVALID_TIME_ZONE_DISPLACEMENT_VALUE
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user