diff --git a/doc/src/sgml/btree.sgml b/doc/src/sgml/btree.sgml
index ca81fbbc848..336d026ea16 100644
--- a/doc/src/sgml/btree.sgml
+++ b/doc/src/sgml/btree.sgml
@@ -344,7 +344,7 @@ returns bool
Before doing so, the function should check the sign
of offset: if it is less than zero, raise
- error ERRCODE_INVALID_PRECEDING_FOLLOWING_SIZE (22013)
+ error ERRCODE_INVALID_PRECEDING_OR_FOLLOWING_SIZE (22013)
with error text like invalid preceding or following size in window
function
. (This is required by the SQL standard, although
nonstandard operator families might perhaps choose to ignore this
diff --git a/src/backend/executor/nodeWindowAgg.c b/src/backend/executor/nodeWindowAgg.c
index fe5369a0c7b..968d5d3771b 100644
--- a/src/backend/executor/nodeWindowAgg.c
+++ b/src/backend/executor/nodeWindowAgg.c
@@ -2056,7 +2056,7 @@ ExecWindowAgg(PlanState *pstate)
if (offset < 0)
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PRECEDING_FOLLOWING_SIZE),
+ (errcode(ERRCODE_INVALID_PRECEDING_OR_FOLLOWING_SIZE),
errmsg("frame starting offset must not be negative")));
}
}
@@ -2081,7 +2081,7 @@ ExecWindowAgg(PlanState *pstate)
if (offset < 0)
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PRECEDING_FOLLOWING_SIZE),
+ (errcode(ERRCODE_INVALID_PRECEDING_OR_FOLLOWING_SIZE),
errmsg("frame ending offset must not be negative")));
}
}
diff --git a/src/backend/utils/adt/date.c b/src/backend/utils/adt/date.c
index eea29044146..87146a21610 100644
--- a/src/backend/utils/adt/date.c
+++ b/src/backend/utils/adt/date.c
@@ -1889,7 +1889,7 @@ in_range_time_interval(PG_FUNCTION_ARGS)
*/
if (offset->time < 0)
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PRECEDING_FOLLOWING_SIZE),
+ (errcode(ERRCODE_INVALID_PRECEDING_OR_FOLLOWING_SIZE),
errmsg("invalid preceding or following size in window function")));
/*
@@ -2391,7 +2391,7 @@ in_range_timetz_interval(PG_FUNCTION_ARGS)
*/
if (offset->time < 0)
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PRECEDING_FOLLOWING_SIZE),
+ (errcode(ERRCODE_INVALID_PRECEDING_OR_FOLLOWING_SIZE),
errmsg("invalid preceding or following size in window function")));
/*
diff --git a/src/backend/utils/adt/float.c b/src/backend/utils/adt/float.c
index d32c1c141f0..b86205b0987 100644
--- a/src/backend/utils/adt/float.c
+++ b/src/backend/utils/adt/float.c
@@ -1198,7 +1198,7 @@ in_range_float8_float8(PG_FUNCTION_ARGS)
*/
if (isnan(offset) || offset < 0)
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PRECEDING_FOLLOWING_SIZE),
+ (errcode(ERRCODE_INVALID_PRECEDING_OR_FOLLOWING_SIZE),
errmsg("invalid preceding or following size in window function")));
/*
@@ -1267,7 +1267,7 @@ in_range_float4_float8(PG_FUNCTION_ARGS)
*/
if (isnan(offset) || offset < 0)
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PRECEDING_FOLLOWING_SIZE),
+ (errcode(ERRCODE_INVALID_PRECEDING_OR_FOLLOWING_SIZE),
errmsg("invalid preceding or following size in window function")));
/*
diff --git a/src/backend/utils/adt/int.c b/src/backend/utils/adt/int.c
index 559c365fecd..02783d8d6fe 100644
--- a/src/backend/utils/adt/int.c
+++ b/src/backend/utils/adt/int.c
@@ -608,7 +608,7 @@ in_range_int4_int4(PG_FUNCTION_ARGS)
if (offset < 0)
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PRECEDING_FOLLOWING_SIZE),
+ (errcode(ERRCODE_INVALID_PRECEDING_OR_FOLLOWING_SIZE),
errmsg("invalid preceding or following size in window function")));
if (sub)
@@ -655,7 +655,7 @@ in_range_int4_int8(PG_FUNCTION_ARGS)
if (offset < 0)
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PRECEDING_FOLLOWING_SIZE),
+ (errcode(ERRCODE_INVALID_PRECEDING_OR_FOLLOWING_SIZE),
errmsg("invalid preceding or following size in window function")));
if (sub)
@@ -690,7 +690,7 @@ in_range_int2_int4(PG_FUNCTION_ARGS)
if (offset < 0)
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PRECEDING_FOLLOWING_SIZE),
+ (errcode(ERRCODE_INVALID_PRECEDING_OR_FOLLOWING_SIZE),
errmsg("invalid preceding or following size in window function")));
if (sub)
diff --git a/src/backend/utils/adt/int8.c b/src/backend/utils/adt/int8.c
index e6bae6860da..96686ccb2c9 100644
--- a/src/backend/utils/adt/int8.c
+++ b/src/backend/utils/adt/int8.c
@@ -487,7 +487,7 @@ in_range_int8_int8(PG_FUNCTION_ARGS)
if (offset < 0)
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PRECEDING_FOLLOWING_SIZE),
+ (errcode(ERRCODE_INVALID_PRECEDING_OR_FOLLOWING_SIZE),
errmsg("invalid preceding or following size in window function")));
if (sub)
diff --git a/src/backend/utils/adt/numeric.c b/src/backend/utils/adt/numeric.c
index 8dfdffcfbd1..074294cbcc1 100644
--- a/src/backend/utils/adt/numeric.c
+++ b/src/backend/utils/adt/numeric.c
@@ -2185,7 +2185,7 @@ in_range_numeric_numeric(PG_FUNCTION_ARGS)
*/
if (NUMERIC_IS_NAN(offset) || NUMERIC_SIGN(offset) == NUMERIC_NEG)
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PRECEDING_FOLLOWING_SIZE),
+ (errcode(ERRCODE_INVALID_PRECEDING_OR_FOLLOWING_SIZE),
errmsg("invalid preceding or following size in window function")));
/*
diff --git a/src/backend/utils/adt/timestamp.c b/src/backend/utils/adt/timestamp.c
index 265b1db7f60..1d75caebe17 100644
--- a/src/backend/utils/adt/timestamp.c
+++ b/src/backend/utils/adt/timestamp.c
@@ -3280,7 +3280,7 @@ in_range_timestamptz_interval(PG_FUNCTION_ARGS)
if (int128_compare(interval_cmp_value(offset), int64_to_int128(0)) < 0)
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PRECEDING_FOLLOWING_SIZE),
+ (errcode(ERRCODE_INVALID_PRECEDING_OR_FOLLOWING_SIZE),
errmsg("invalid preceding or following size in window function")));
/* We don't currently bother to avoid overflow hazards here */
@@ -3311,7 +3311,7 @@ in_range_timestamp_interval(PG_FUNCTION_ARGS)
if (int128_compare(interval_cmp_value(offset), int64_to_int128(0)) < 0)
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PRECEDING_FOLLOWING_SIZE),
+ (errcode(ERRCODE_INVALID_PRECEDING_OR_FOLLOWING_SIZE),
errmsg("invalid preceding or following size in window function")));
/* We don't currently bother to avoid overflow hazards here */
@@ -3342,7 +3342,7 @@ in_range_interval_interval(PG_FUNCTION_ARGS)
if (int128_compare(interval_cmp_value(offset), int64_to_int128(0)) < 0)
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PRECEDING_FOLLOWING_SIZE),
+ (errcode(ERRCODE_INVALID_PRECEDING_OR_FOLLOWING_SIZE),
errmsg("invalid preceding or following size in window function")));
/* We don't currently bother to avoid overflow hazards here */
diff --git a/src/backend/utils/errcodes.txt b/src/backend/utils/errcodes.txt
index 9871d1e7931..e2976600e84 100644
--- a/src/backend/utils/errcodes.txt
+++ b/src/backend/utils/errcodes.txt
@@ -177,7 +177,7 @@ Section: Class 22 - Data Exception
22P06 E ERRCODE_NONSTANDARD_USE_OF_ESCAPE_CHARACTER nonstandard_use_of_escape_character
22010 E ERRCODE_INVALID_INDICATOR_PARAMETER_VALUE invalid_indicator_parameter_value
22023 E ERRCODE_INVALID_PARAMETER_VALUE invalid_parameter_value
-22013 E ERRCODE_INVALID_PRECEDING_FOLLOWING_SIZE invalid_preceding_following_size
+22013 E ERRCODE_INVALID_PRECEDING_OR_FOLLOWING_SIZE invalid_preceding_or_following_size
2201B E ERRCODE_INVALID_REGULAR_EXPRESSION invalid_regular_expression
2201W E ERRCODE_INVALID_ROW_COUNT_IN_LIMIT_CLAUSE invalid_row_count_in_limit_clause
2201X E ERRCODE_INVALID_ROW_COUNT_IN_RESULT_OFFSET_CLAUSE invalid_row_count_in_result_offset_clause