Reputation: 6781
I encounter this error message when running my specs after messing with gemsets and the pg gem version:
# --- Caused by: ---
# PG::UndefinedColumn:
# ERROR: column "waiting" does not exist
# LINE 1: ...me AS source, age(now(), xact_start) AS duration, waiting, q...
# ^
# /Users/xx/.rvm/gems/ruby-2.3.3@xx/gems/pghero-1.4.2/lib/pghero/methods/basic.rb:84:in `select_all'
I've tried using both versions of pg gem that I've used yesterday(0.18.4
and 0.19.0
) by specifiying the exact version in the Gemfile, installing them (bundle install
) and confirmed that the version is in deed used by checking Gemfile.lock
. Both keep producing the error.
I am not really experienced, especially with Postgres. I don't know how gems and OS-packages play together etc. So I wanted to know if anyone knows what's going on and give me a tip?
Thanks
Upvotes: 0
Views: 1120
Reputation: 620
I have the following questions and advices for you
bundle install
Did you switch to another ruby version (even minor is relevant)? If so drop the whole gemset (rvm gemset delete
) and run a fresh bundle install
. This will build all native extensions against the updated ruby version.
Hope this helps.
Upvotes: 1
Reputation: 51649
The problem is Postgres version. in 9.6 pg_stat_activity
... replace the waiting column with wait_event_type and wait_event.
As workaround you can try change in script, causing exception:
, age(now(), xact_start) AS duration, waiting,
to:
, age(now(), xact_start) AS duration, case when wait_event_type is null then false else true waiting,
Upvotes: 1