1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

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:
Peter Eisentraut
2009-03-04 10:55:00 +00:00
parent 9add9f95c3
commit 12f87b2c82
4 changed files with 28 additions and 17 deletions

View File

@ -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;
}