Problems with pg 0.13.0 gem

after updating pg gem to 0.13.0 got following error on production server (rails 3.2.1 + unicorn): "Use of uninitialized PG::Connection. (fatal)", here is some trace from unicorn_error.log:

/srv/site/shared/bundle/ruby/1.9/gems/activerecord-3.2.1/lib/ active_record/connection_adapters/postgresql_adapter.rb:355:in `finish': Use of uninitialized PG::Connection. (fatal)   from /srv/site/shared/bundle/ruby/1.9/gems/activerecord-3.2.1/lib/ active_record/connection_adapters/postgresql_adapter.rb:355:in `disconnect!'   from /srv/site/shared/config/unicorn.rb:26:in `block in reload'   from /srv/site/shared/bundle/ruby/1.9/gems/unicorn-4.2.0/lib/unicorn/ http_server.rb:482:in `call'   from /srv/site/shared/bundle/ruby/1.9/gems/unicorn-4.2.0/lib/unicorn/ http_server.rb:482:in `spawn_missing_workers'   from /srv/site/shared/bundle/ruby/1.9/gems/unicorn-4.2.0/lib/unicorn/ http_server.rb:137:in `start'   from /srv/site/shared/bundle/ruby/1.9/gems/unicorn-4.2.0/bin/ unicorn_rails:209:in `<top (required)>'   from /srv/site/shared/bundle/ruby/1.9/bin/unicorn_rails:19:in `load'   from /srv/site/shared/bundle/ruby/1.9/bin/unicorn_rails:19:in `<main>' /srv/site/shared/bundle/ruby/1.9/gems/activerecord-3.2.1/lib/ active_record/connection_adapters/postgresql_adapter.rb:355:in `finish': Use of uninitialized PG::Connection. (fatal)   from /srv/site/shared/bundle/ruby/1.9/gems/activerecord-3.2.1/lib/ active_record/connection_adapters/postgresql_adapter.rb:355:in `disconnect!'   from /srv/site/shared/bundle/ruby/1.9/gems/activerecord-3.2.1/lib/ active_record/connection_adapters/abstract/connection_pool.rb:134:in `block (2 levels) in disconnect!'   from /srv/site/shared/bundle/ruby/1.9/gems/activerecord-3.2.1/lib/ active_record/connection_adapters/abstract/connection_pool.rb:132:in `each'   from /srv/site/shared/bundle/ruby/1.9/gems/activerecord-3.2.1/lib/ active_record/connection_adapters/abstract/connection_pool.rb:132:in `block in disconnect!'   from /usr/local/lib/ruby/1.9/monitor.rb:211:in `mon_synchronize'   from /srv/site/shared/bundle/ruby/1.9/gems/activerecord-3.2.1/lib/ active_record/connection_adapters/abstract/connection_pool.rb:130:in `disconnect!'   from /srv/site/shared/bundle/ruby/1.9/gems/activerecord-3.2.1/lib/ active_record/connection_adapters/abstract/connection_pool.rb:394:in `remove_connection'   from /srv/site/shared/bundle/ruby/1.9/gems/activerecord-3.2.1/lib/ active_record/connection_adapters/abstract/connection_specification.rb: 177:in `remove_connection'   from /srv/site/shared/bundle/ruby/1.9/gems/activerecord-3.2.1/lib/ active_record/connection_adapters/abstract/connection_specification.rb: 133:in `establish_connection'   from /srv/site/shared/config/unicorn.rb:39:in `block in reload'   from /srv/site/shared/bundle/ruby/1.9/gems/unicorn-4.2.0/lib/unicorn/ http_server.rb:563:in `call'   from /srv/site/shared/bundle/ruby/1.9/gems/unicorn-4.2.0/lib/unicorn/ http_server.rb:563:in `init_worker_process'   from /srv/site/shared/bundle/ruby/1.9/gems/unicorn-4.2.0/lib/unicorn/ http_server.rb:587:in `worker_loop'   from /srv/site/shared/bundle/ruby/1.9/gems/unicorn-4.2.0/lib/unicorn/ http_server.rb:487:in `spawn_missing_workers'   from /srv/site/shared/bundle/ruby/1.9/gems/unicorn-4.2.0/lib/unicorn/ http_server.rb:137:in `start'   from /srv/site/shared/bundle/ruby/1.9/gems/unicorn-4.2.0/bin/ unicorn_rails:209:in `<top (required)>'   from /srv/site/shared/bundle/ruby/1.9/bin/unicorn_rails:19:in `load'   from /srv/site/shared/bundle/ruby/1.9/bin/unicorn_rails:19:in `<main>'

no code from pg gem present in the trace had to rollback to pg 0.12.2

has anyone used 0.13.0 successfully?

Hi! Johann Aman

I can reproduce this issue.

Do you confirm the following commit ? https://github.com/kennyj/rails/commit/b40b7f459e3ea66f824ac4791d8882775b4f6717

Dear, Johann Aman

pg gem 0.13.1 was released. And, the bahavior was changed. You can use it !

Please see also https://github.com/rails/rails/pull/5002 .

thank you, kennyj, I already installed it:)