Make new error code name match SQL standard more closely
authorPeter Eisentraut
Mon, 11 Jun 2018 15:15:28 +0000 (11:15 -0400)
committerPeter Eisentraut
Mon, 11 Jun 2018 15:15:28 +0000 (11:15 -0400)
Discussion: https://www.postgresql.org/message-id/dff3d555-bea4-ac24-29b2-29521b9d08e8%402ndquadrant.com

doc/src/sgml/btree.sgml
src/backend/executor/nodeWindowAgg.c
src/backend/utils/adt/date.c
src/backend/utils/adt/float.c
src/backend/utils/adt/int.c
src/backend/utils/adt/int8.c
src/backend/utils/adt/numeric.c
src/backend/utils/adt/timestamp.c
src/backend/utils/errcodes.txt

index ca81fbbc84822ea5a1a68d9544f11ad74fe9e9ed..336d026ea16032bcb41581d1f4c09bcdb6b0d866 100644 (file)
@@ -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
index fe5369a0c7b70ea338fa38adc43f9985f860581a..968d5d3771b24b7f606a65383ca454f21b47ec39 100644 (file)
@@ -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")));
            }
        }
index eea290441468ba5c5b87ea6b97b1ebd4047fc0b9..87146a21610f4ff0102df03256415c6798a2ed13 100644 (file)
@@ -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")));
 
    /*
index d32c1c141f0f9e94032fd8f94495b0f702b42ab5..b86205b0987181e5427745316137434cab2b2b63 100644 (file)
@@ -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")));
 
    /*
index 559c365fecd013898a65191978d5eb35511cdb7d..02783d8d6fe59cc7c7e63f5c1a87a02f93728877 100644 (file)
@@ -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)
index e6bae6860daad6ab19716ae32bdcf4653331a164..96686ccb2c903de1acb7330370e69ba617f388c0 100644 (file)
@@ -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)
index 8dfdffcfbd1cf2b90a914e66ca1bdbf45419fd83..074294cbcc10b0f4bf2ff4225c508f3c7299e454 100644 (file)
@@ -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")));
 
    /*
index 265b1db7f60299f126a16a6886c186f4becbd47d..1d75caebe174e4cc20912017eb34d7376cab8b2e 100644 (file)
@@ -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 */
index 9871d1e7931c5bef2acef1cb52f8d7b400877f0b..e2976600e84ecf6519227aa7503883241dba0954 100644 (file)
@@ -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