Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 387543f

Browse files
committed
Make new error code name match SQL standard more closely
Discussion: https://www.postgresql.org/message-id/dff3d555-bea4-ac24-29b2-29521b9d08e8%402ndquadrant.com
1 parent bfbb132 commit 387543f

File tree

9 files changed

+16
-16
lines changed

9 files changed

+16
-16
lines changed

doc/src/sgml/btree.sgml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ returns bool
344344
</itemizedlist>
345345
Before doing so, the function should check the sign
346346
of <replaceable>offset</replaceable>: if it is less than zero, raise
347-
error <literal>ERRCODE_INVALID_PRECEDING_FOLLOWING_SIZE</literal> (22013)
347+
error <literal>ERRCODE_INVALID_PRECEDING_OR_FOLLOWING_SIZE</literal> (22013)
348348
with error text like <quote>invalid preceding or following size in window
349349
function</quote>. (This is required by the SQL standard, although
350350
nonstandard operator families might perhaps choose to ignore this

src/backend/executor/nodeWindowAgg.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2056,7 +2056,7 @@ ExecWindowAgg(PlanState *pstate)
20562056

20572057
if (offset < 0)
20582058
ereport(ERROR,
2059-
(errcode(ERRCODE_INVALID_PRECEDING_FOLLOWING_SIZE),
2059+
(errcode(ERRCODE_INVALID_PRECEDING_OR_FOLLOWING_SIZE),
20602060
errmsg("frame starting offset must not be negative")));
20612061
}
20622062
}
@@ -2081,7 +2081,7 @@ ExecWindowAgg(PlanState *pstate)
20812081

20822082
if (offset < 0)
20832083
ereport(ERROR,
2084-
(errcode(ERRCODE_INVALID_PRECEDING_FOLLOWING_SIZE),
2084+
(errcode(ERRCODE_INVALID_PRECEDING_OR_FOLLOWING_SIZE),
20852085
errmsg("frame ending offset must not be negative")));
20862086
}
20872087
}

src/backend/utils/adt/date.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1889,7 +1889,7 @@ in_range_time_interval(PG_FUNCTION_ARGS)
18891889
*/
18901890
if (offset->time < 0)
18911891
ereport(ERROR,
1892-
(errcode(ERRCODE_INVALID_PRECEDING_FOLLOWING_SIZE),
1892+
(errcode(ERRCODE_INVALID_PRECEDING_OR_FOLLOWING_SIZE),
18931893
errmsg("invalid preceding or following size in window function")));
18941894

18951895
/*
@@ -2391,7 +2391,7 @@ in_range_timetz_interval(PG_FUNCTION_ARGS)
23912391
*/
23922392
if (offset->time < 0)
23932393
ereport(ERROR,
2394-
(errcode(ERRCODE_INVALID_PRECEDING_FOLLOWING_SIZE),
2394+
(errcode(ERRCODE_INVALID_PRECEDING_OR_FOLLOWING_SIZE),
23952395
errmsg("invalid preceding or following size in window function")));
23962396

23972397
/*

src/backend/utils/adt/float.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,7 +1198,7 @@ in_range_float8_float8(PG_FUNCTION_ARGS)
11981198
*/
11991199
if (isnan(offset) || offset < 0)
12001200
ereport(ERROR,
1201-
(errcode(ERRCODE_INVALID_PRECEDING_FOLLOWING_SIZE),
1201+
(errcode(ERRCODE_INVALID_PRECEDING_OR_FOLLOWING_SIZE),
12021202
errmsg("invalid preceding or following size in window function")));
12031203

12041204
/*
@@ -1267,7 +1267,7 @@ in_range_float4_float8(PG_FUNCTION_ARGS)
12671267
*/
12681268
if (isnan(offset) || offset < 0)
12691269
ereport(ERROR,
1270-
(errcode(ERRCODE_INVALID_PRECEDING_FOLLOWING_SIZE),
1270+
(errcode(ERRCODE_INVALID_PRECEDING_OR_FOLLOWING_SIZE),
12711271
errmsg("invalid preceding or following size in window function")));
12721272

12731273
/*

src/backend/utils/adt/int.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ in_range_int4_int4(PG_FUNCTION_ARGS)
608608

609609
if (offset < 0)
610610
ereport(ERROR,
611-
(errcode(ERRCODE_INVALID_PRECEDING_FOLLOWING_SIZE),
611+
(errcode(ERRCODE_INVALID_PRECEDING_OR_FOLLOWING_SIZE),
612612
errmsg("invalid preceding or following size in window function")));
613613

614614
if (sub)
@@ -655,7 +655,7 @@ in_range_int4_int8(PG_FUNCTION_ARGS)
655655

656656
if (offset < 0)
657657
ereport(ERROR,
658-
(errcode(ERRCODE_INVALID_PRECEDING_FOLLOWING_SIZE),
658+
(errcode(ERRCODE_INVALID_PRECEDING_OR_FOLLOWING_SIZE),
659659
errmsg("invalid preceding or following size in window function")));
660660

661661
if (sub)
@@ -690,7 +690,7 @@ in_range_int2_int4(PG_FUNCTION_ARGS)
690690

691691
if (offset < 0)
692692
ereport(ERROR,
693-
(errcode(ERRCODE_INVALID_PRECEDING_FOLLOWING_SIZE),
693+
(errcode(ERRCODE_INVALID_PRECEDING_OR_FOLLOWING_SIZE),
694694
errmsg("invalid preceding or following size in window function")));
695695

696696
if (sub)

src/backend/utils/adt/int8.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ in_range_int8_int8(PG_FUNCTION_ARGS)
487487

488488
if (offset < 0)
489489
ereport(ERROR,
490-
(errcode(ERRCODE_INVALID_PRECEDING_FOLLOWING_SIZE),
490+
(errcode(ERRCODE_INVALID_PRECEDING_OR_FOLLOWING_SIZE),
491491
errmsg("invalid preceding or following size in window function")));
492492

493493
if (sub)

src/backend/utils/adt/numeric.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2185,7 +2185,7 @@ in_range_numeric_numeric(PG_FUNCTION_ARGS)
21852185
*/
21862186
if (NUMERIC_IS_NAN(offset) || NUMERIC_SIGN(offset) == NUMERIC_NEG)
21872187
ereport(ERROR,
2188-
(errcode(ERRCODE_INVALID_PRECEDING_FOLLOWING_SIZE),
2188+
(errcode(ERRCODE_INVALID_PRECEDING_OR_FOLLOWING_SIZE),
21892189
errmsg("invalid preceding or following size in window function")));
21902190

21912191
/*

src/backend/utils/adt/timestamp.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3280,7 +3280,7 @@ in_range_timestamptz_interval(PG_FUNCTION_ARGS)
32803280

32813281
if (int128_compare(interval_cmp_value(offset), int64_to_int128(0)) < 0)
32823282
ereport(ERROR,
3283-
(errcode(ERRCODE_INVALID_PRECEDING_FOLLOWING_SIZE),
3283+
(errcode(ERRCODE_INVALID_PRECEDING_OR_FOLLOWING_SIZE),
32843284
errmsg("invalid preceding or following size in window function")));
32853285

32863286
/* We don't currently bother to avoid overflow hazards here */
@@ -3311,7 +3311,7 @@ in_range_timestamp_interval(PG_FUNCTION_ARGS)
33113311

33123312
if (int128_compare(interval_cmp_value(offset), int64_to_int128(0)) < 0)
33133313
ereport(ERROR,
3314-
(errcode(ERRCODE_INVALID_PRECEDING_FOLLOWING_SIZE),
3314+
(errcode(ERRCODE_INVALID_PRECEDING_OR_FOLLOWING_SIZE),
33153315
errmsg("invalid preceding or following size in window function")));
33163316

33173317
/* We don't currently bother to avoid overflow hazards here */
@@ -3342,7 +3342,7 @@ in_range_interval_interval(PG_FUNCTION_ARGS)
33423342

33433343
if (int128_compare(interval_cmp_value(offset), int64_to_int128(0)) < 0)
33443344
ereport(ERROR,
3345-
(errcode(ERRCODE_INVALID_PRECEDING_FOLLOWING_SIZE),
3345+
(errcode(ERRCODE_INVALID_PRECEDING_OR_FOLLOWING_SIZE),
33463346
errmsg("invalid preceding or following size in window function")));
33473347

33483348
/* We don't currently bother to avoid overflow hazards here */

src/backend/utils/errcodes.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ Section: Class 22 - Data Exception
177177
22P06 E ERRCODE_NONSTANDARD_USE_OF_ESCAPE_CHARACTER nonstandard_use_of_escape_character
178178
22010 E ERRCODE_INVALID_INDICATOR_PARAMETER_VALUE invalid_indicator_parameter_value
179179
22023 E ERRCODE_INVALID_PARAMETER_VALUE invalid_parameter_value
180-
22013 E ERRCODE_INVALID_PRECEDING_FOLLOWING_SIZE invalid_preceding_following_size
180+
22013 E ERRCODE_INVALID_PRECEDING_OR_FOLLOWING_SIZE invalid_preceding_or_following_size
181181
2201B E ERRCODE_INVALID_REGULAR_EXPRESSION invalid_regular_expression
182182
2201W E ERRCODE_INVALID_ROW_COUNT_IN_LIMIT_CLAUSE invalid_row_count_in_limit_clause
183183
2201X E ERRCODE_INVALID_ROW_COUNT_IN_RESULT_OFFSET_CLAUSE invalid_row_count_in_result_offset_clause

0 commit comments

Comments
 (0)