Commit cd603a4d authored by Peter Eisentraut's avatar Peter Eisentraut

Use SQL standard error code for nextval

parent be37c212
...@@ -694,7 +694,7 @@ nextval_internal(Oid relid) ...@@ -694,7 +694,7 @@ nextval_internal(Oid relid)
snprintf(buf, sizeof(buf), INT64_FORMAT, maxv); snprintf(buf, sizeof(buf), INT64_FORMAT, maxv);
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), (errcode(ERRCODE_SEQUENCE_GENERATOR_LIMIT_EXCEEDED),
errmsg("nextval: reached maximum value of sequence \"%s\" (%s)", errmsg("nextval: reached maximum value of sequence \"%s\" (%s)",
RelationGetRelationName(seqrel), buf))); RelationGetRelationName(seqrel), buf)));
} }
...@@ -717,7 +717,7 @@ nextval_internal(Oid relid) ...@@ -717,7 +717,7 @@ nextval_internal(Oid relid)
snprintf(buf, sizeof(buf), INT64_FORMAT, minv); snprintf(buf, sizeof(buf), INT64_FORMAT, minv);
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), (errcode(ERRCODE_SEQUENCE_GENERATOR_LIMIT_EXCEEDED),
errmsg("nextval: reached minimum value of sequence \"%s\" (%s)", errmsg("nextval: reached minimum value of sequence \"%s\" (%s)",
RelationGetRelationName(seqrel), buf))); RelationGetRelationName(seqrel), buf)));
} }
......
...@@ -188,6 +188,7 @@ Section: Class 22 - Data Exception ...@@ -188,6 +188,7 @@ Section: Class 22 - Data Exception
22004 E ERRCODE_NULL_VALUE_NOT_ALLOWED null_value_not_allowed 22004 E ERRCODE_NULL_VALUE_NOT_ALLOWED null_value_not_allowed
22002 E ERRCODE_NULL_VALUE_NO_INDICATOR_PARAMETER null_value_no_indicator_parameter 22002 E ERRCODE_NULL_VALUE_NO_INDICATOR_PARAMETER null_value_no_indicator_parameter
22003 E ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE numeric_value_out_of_range 22003 E ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE numeric_value_out_of_range
2200H E ERRCODE_SEQUENCE_GENERATOR_LIMIT_EXCEEDED sequence_generator_limit_exceeded
22026 E ERRCODE_STRING_DATA_LENGTH_MISMATCH string_data_length_mismatch 22026 E ERRCODE_STRING_DATA_LENGTH_MISMATCH string_data_length_mismatch
22001 E ERRCODE_STRING_DATA_RIGHT_TRUNCATION string_data_right_truncation 22001 E ERRCODE_STRING_DATA_RIGHT_TRUNCATION string_data_right_truncation
22011 E ERRCODE_SUBSTRING_ERROR substring_error 22011 E ERRCODE_SUBSTRING_ERROR substring_error
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment