Skip to content

Commit

Permalink
Update error codes to PostgreSQL-15
Browse files Browse the repository at this point in the history
  • Loading branch information
larskanis committed Nov 17, 2022
1 parent 8431e47 commit f52e8ea
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,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/REL_14_0"
URL_ERRORCODES_TXT = "http://git.postgresql.org/gitweb/?p=postgresql.git;a=blob_plain;f=src/backend/utils/errcodes.txt;hb=refs/tags/REL_15_0"

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
4 changes: 4 additions & 0 deletions ext/errorcodes.def
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,10 @@
VALUE klass = define_error_class( "SqlJsonScalarRequired", "22" );
register_error_class( "2203F", klass );
}
{
VALUE klass = define_error_class( "SqlJsonItemCannotBeCastToTargetType", "22" );
register_error_class( "2203G", klass );
}
{
VALUE klass = define_error_class( "IntegrityConstraintViolation", NULL );
register_error_class( "23000", klass );
Expand Down
3 changes: 2 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-2021, PostgreSQL Global Development Group
# Copyright (c) 2003-2022, 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 @@ -222,6 +222,7 @@ Section: Class 22 - Data Exception
2203D E ERRCODE_TOO_MANY_JSON_ARRAY_ELEMENTS too_many_json_array_elements
2203E E ERRCODE_TOO_MANY_JSON_OBJECT_MEMBERS too_many_json_object_members
2203F E ERRCODE_SQL_JSON_SCALAR_REQUIRED sql_json_scalar_required
2203G E ERRCODE_SQL_JSON_ITEM_CANNOT_BE_CAST_TO_TARGET_TYPE sql_json_item_cannot_be_cast_to_target_type

Section: Class 23 - Integrity Constraint Violation

Expand Down

0 comments on commit f52e8ea

Please sign in to comment.