diff --git a/.github/workflows/binary-gems.yml b/.github/workflows/binary-gems.yml index d475a454..8067c131 100644 --- a/.github/workflows/binary-gems.yml +++ b/.github/workflows/binary-gems.yml @@ -52,7 +52,7 @@ jobs: - os: windows-latest ruby: "3.3" platform: "x64-mingw-ucrt" - PGVERSION: 16.0-1-windows-x64 + PGVERSION: 17.0-1-windows-x64 - os: windows-latest ruby: "3.1.4-1" platform: "x86-mingw32" diff --git a/.github/workflows/source-gem.yml b/.github/workflows/source-gem.yml index c1e4cd46..2f37bf59 100644 --- a/.github/workflows/source-gem.yml +++ b/.github/workflows/source-gem.yml @@ -44,19 +44,19 @@ jobs: include: - os: windows ruby: "head" - PGVERSION: 16.0-1-windows-x64 - PGVER: "16" + PGVERSION: 17.0-1-windows-x64 + PGVER: "17" - os: windows ruby: "2.5" PGVERSION: 9.4.26-1-windows-x64 PGVER: "9.4" - os: windows ruby: "mswin" - PGVERSION: 16.0-1-windows-x64 - PGVER: "16" + PGVERSION: 17.0-1-windows-x64 + PGVER: "17" - os: ubuntu ruby: "head" - PGVER: "16" + PGVER: "17" - os: ubuntu ruby: "3.2" PGVER: "12" @@ -69,11 +69,11 @@ jobs: PGVER: "13" - os: ubuntu ruby: "truffleruby-head" - PGVER: "16" + PGVER: "17" - os: macos ruby: "head" - PGVERSION: 16.0-1-osx - PGVER: "16" + PGVERSION: 17.0-1-osx + PGVER: "17" runs-on: ${{ matrix.os }}-${{ matrix.os_ver || 'latest' }} env: diff --git a/Rakefile b/Rakefile index be95343d..6b44a2f8 100644 --- a/Rakefile +++ b/Rakefile @@ -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}" diff --git a/Rakefile.cross b/Rakefile.cross index c01b77b5..bb832e70 100644 --- a/Rakefile.cross +++ b/Rakefile.cross @@ -31,8 +31,8 @@ class CrossLibrary < OpenStruct self.host_platform = toolchain # Cross-compilation constants - self.openssl_version = ENV['OPENSSL_VERSION'] || '3.3.2' - self.postgresql_version = ENV['POSTGRESQL_VERSION'] || '16.4' + self.openssl_version = ENV['OPENSSL_VERSION'] || '3.4.0' + self.postgresql_version = ENV['POSTGRESQL_VERSION'] || '17.0' # Check if symlinks work in the current working directory. # This fails, if rake-compiler-dock is running on a Windows box. @@ -206,6 +206,10 @@ class CrossLibrary < OpenStruct chdir( static_postgresql_srcdir + "common" ) do sh 'make', "-j#{NUM_CPUS}" end + # Work around missing dependency to errorcodes.h in PostgreSQL-17.0 + chdir( static_postgresql_srcdir + "backend" + "utils" ) do + sh 'make', "-j#{NUM_CPUS}" + end chdir( static_postgresql_srcdir + "port" ) do sh 'make', "-j#{NUM_CPUS}" end @@ -289,6 +293,7 @@ CrossLibraries.each do |xlib| task "gem:windows:#{platform}" => ['gem:windows:prepare', xlib.openssl_tarball, xlib.postgresql_tarball] do RakeCompilerDock.sh <<-EOT, platform: platform (cp build/gem/gem-*.pem ~/.gem/ || true) && + sudo apt-get update && sudo apt-get install -y bison flex && bundle install --local && rake native:#{platform} pkg/#{$gem_spec.full_name}-#{platform}.gem MAKEOPTS=-j`nproc` RUBY_CC_VERSION=3.3.0:3.2.0:3.1.0:3.0.0:2.7.0:2.6.0:2.5.0 EOT diff --git a/ext/errorcodes.def b/ext/errorcodes.def index 5c501d79..ca0af630 100644 --- a/ext/errorcodes.def +++ b/ext/errorcodes.def @@ -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 ); @@ -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 ); diff --git a/ext/errorcodes.txt b/ext/errorcodes.txt index 3d244af1..3250d539 100644 --- a/ext/errorcodes.txt +++ b/ext/errorcodes.txt @@ -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 @@ -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 @@ -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) diff --git a/spec/pg/connection_spec.rb b/spec/pg/connection_spec.rb index 3f3244ab..0f214863 100644 --- a/spec/pg/connection_spec.rb +++ b/spec/pg/connection_spec.rb @@ -588,8 +588,6 @@ end it "doesn't notify the wrong thread about closed socket (Bug #564)" do - skip "this spec crashs silently on Windows for some reason (pending investigation)" if RUBY_PLATFORM=~/mingw|mswin/i - 10.times do 10.times.map do Thread.new do