Skip to content

Commit

Permalink
Update error codes per 'rake update_error_codes'
Browse files Browse the repository at this point in the history
  • Loading branch information
larskanis committed Dec 5, 2017
1 parent 5d6761c commit b19b5f4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ end

desc "Update list of server error codes"
task :update_error_codes do
URL_ERRORCODES_TXT = "http://git.postgresql.org/gitweb/?p=postgresql.git;a=blob_plain;f=src/backend/utils/errcodes.txt;hb=refs/tags/REL9_6_1"
URL_ERRORCODES_TXT = "http://git.postgresql.org/gitweb/?p=postgresql.git;a=blob_plain;f=src/backend/utils/errcodes.txt;hb=refs/tags/REL_10_1"

ERRORCODES_TXT = "ext/errorcodes.txt"
sh "wget #{URL_ERRORCODES_TXT.inspect} -O #{ERRORCODES_TXT.inspect} || curl #{URL_ERRORCODES_TXT.inspect} -o #{ERRORCODES_TXT.inspect}"
Expand Down
8 changes: 8 additions & 0 deletions ext/errorcodes.def
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,10 @@
VALUE klass = define_error_class( "NumericValueOutOfRange", "22" );
register_error_class( "22003", klass );
}
{
VALUE klass = define_error_class( "SequenceGeneratorLimitExceeded", "22" );
register_error_class( "2200H", klass );
}
{
VALUE klass = define_error_class( "StringDataLengthMismatch", "22" );
register_error_class( "22026", klass );
Expand Down Expand Up @@ -587,6 +591,10 @@
VALUE klass = define_error_class( "WrongObjectType", "42" );
register_error_class( "42809", klass );
}
{
VALUE klass = define_error_class( "GeneratedAlways", "42" );
register_error_class( "428C9", klass );
}
{
VALUE klass = define_error_class( "UndefinedColumn", "42" );
register_error_class( "42703", klass );
Expand Down
4 changes: 3 additions & 1 deletion ext/errorcodes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# errcodes.txt
# PostgreSQL error codes
#
# Copyright (c) 2003-2016, PostgreSQL Global Development Group
# Copyright (c) 2003-2017, PostgreSQL Global Development Group
#
# This list serves as the basis for generating source files containing error
# codes. It is kept in a common format to make sure all these source files have
Expand Down Expand Up @@ -188,6 +188,7 @@ Section: Class 22 - Data Exception
22004 E ERRCODE_NULL_VALUE_NOT_ALLOWED null_value_not_allowed
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
2200H E ERRCODE_SEQUENCE_GENERATOR_LIMIT_EXCEEDED sequence_generator_limit_exceeded
22026 E ERRCODE_STRING_DATA_LENGTH_MISMATCH string_data_length_mismatch
22001 E ERRCODE_STRING_DATA_RIGHT_TRUNCATION string_data_right_truncation
22011 E ERRCODE_SUBSTRING_ERROR substring_error
Expand Down Expand Up @@ -326,6 +327,7 @@ Section: Class 42 - Syntax Error or Access Rule Violation
42P21 E ERRCODE_COLLATION_MISMATCH collation_mismatch
42P22 E ERRCODE_INDETERMINATE_COLLATION indeterminate_collation
42809 E ERRCODE_WRONG_OBJECT_TYPE wrong_object_type
428C9 E ERRCODE_GENERATED_ALWAYS generated_always

# Note: for ERRCODE purposes, we divide namable objects into these categories:
# databases, schemas, prepared statements, cursors, tables, columns,
Expand Down

0 comments on commit b19b5f4

Please sign in to comment.