You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Emit a warning when pg gem < 1.6.0 is used with PostgreSQL 18+
Split from rails#55282
This commit emits a warning when `pg` gem < 1.6.0 is used with PostgreSQL 18+
to prevent compatibility issues of PG::Connection#cancel.
PostgreSQL 18 (scheduled for release around September/October 2025) changes the format of the cancel request key
, which causes PG::Connection#cancel to fail with pg gem 1.5.9 and below.
This issue is already addressed in ged/ruby-pg#614 and the fix is included in pg gem v1.6.0 (currently released as v1.6.0.rc2).
Instead of requiring pg gem 1.6+ for all users when raising minimum supported PostgreSQL version to 10 discussed at rails#55282 ,
warnings are only shown to PostgreSQL 18+ + pg gem ≤ 1.5.9 users actually affected by the PG::Connection#cancel behavior.
Also skip the failing test if pg gem version < 1.6.0 and PostgreSQL version is 18+.
```
$ bundle info pg
* pg (1.5.9)
Summary: Pg is the Ruby interface to the PostgreSQL RDBMS
Homepage: https://github.com/ged/ruby-pg
Documentation: http://deveiate.org/code/pg
Source Code: https://github.com/ged/ruby-pg
Changelog: https://github.com/ged/ruby-pg/blob/master/History.md
Path: /home/yahonda/.local/share/mise/installs/ruby/3.4.4/lib/ruby/gems/3.4.0/gems/pg-1.5.9
Reverse Dependencies:
queue_classic (4.0.0) depends on pg (>= 1.1, < 2.0)
$
$ ARCONN=postgresql bin/test test/cases/adapters/postgresql/transaction_test.rb -n test_raises_Interrupt_when_canceling_statement_via_interrupt
Using postgresql
Run options: -n test_raises_Interrupt_when_canceling_statement_via_interrupt --seed 17678
F
Failure:
ActiveRecord::PostgresqlTransactionTest#test_raises_Interrupt_when_canceling_statement_via_interrupt [test/cases/adapters/postgresql/transaction_test.rb:199]:
Expected 10.014372003 to be < 5.
bin/test test/cases/adapters/postgresql/transaction_test.rb:183
Finished in 10.067954s, 0.0993 runs/s, 0.1987 assertions/s.
1 runs, 2 assertions, 1 failures, 0 errors, 0 skips
```
0 commit comments