Skip to content

Commit

Permalink
Update error codes by rake update_error_codes
Browse files Browse the repository at this point in the history
  • Loading branch information
larskanis committed Oct 24, 2024
1 parent 94f1d7f commit 86367c6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,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_16_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_17_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
9 changes: 4 additions & 5 deletions ext/errorcodes.def
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,10 @@
VALUE klass = define_error_class( "IdleInTransactionSessionTimeout", "25" );
register_error_class( "25P03", klass );
}
{
VALUE klass = define_error_class( "TransactionTimeout", "25" );
register_error_class( "25P04", klass );
}
{
VALUE klass = define_error_class( "InvalidSqlStatementName", NULL );
register_error_class( "26000", klass );
Expand Down Expand Up @@ -885,11 +889,6 @@
VALUE klass = define_error_class( "DuplicateFile", "58" );
register_error_class( "58P02", klass );
}
{
VALUE klass = define_error_class( "SnapshotTooOld", NULL );
register_error_class( "72000", klass );
register_error_class( "72", klass );
}
{
VALUE klass = define_error_class( "ConfigFileError", NULL );
register_error_class( "F0000", klass );
Expand Down
7 changes: 2 additions & 5 deletions 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-2023, PostgreSQL Global Development Group
# Copyright (c) 2003-2024, 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 @@ -252,6 +252,7 @@ Section: Class 25 - Invalid Transaction State
25P01 E ERRCODE_NO_ACTIVE_SQL_TRANSACTION no_active_sql_transaction
25P02 E ERRCODE_IN_FAILED_SQL_TRANSACTION in_failed_sql_transaction
25P03 E ERRCODE_IDLE_IN_TRANSACTION_SESSION_TIMEOUT idle_in_transaction_session_timeout
25P04 E ERRCODE_TRANSACTION_TIMEOUT transaction_timeout

Section: Class 26 - Invalid SQL Statement Name

Expand Down Expand Up @@ -439,10 +440,6 @@ Section: Class 58 - System Error (errors external to PostgreSQL itself)
58P01 E ERRCODE_UNDEFINED_FILE undefined_file
58P02 E ERRCODE_DUPLICATE_FILE duplicate_file

Section: Class 72 - Snapshot Failure
# (class borrowed from Oracle)
72000 E ERRCODE_SNAPSHOT_TOO_OLD snapshot_too_old

Section: Class F0 - Configuration File Error

# (PostgreSQL-specific error class)
Expand Down

0 comments on commit 86367c6

Please sign in to comment.