0

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

4
  • can you try migrating once -> rake db:migrate Commented Feb 7, 2017 at 9:47
  • Did the specs run fine before this ? I think your test environment miss some migrations. Commented Feb 7, 2017 at 9:47
  • I ran migrations in test and dev environments Commented Feb 7, 2017 at 10:03
  • postgres 9.5 has column waiting in pg_stat_activity and 9.6 has wait_event_type instead - this causes the error Commented Feb 7, 2017 at 10:41

2 Answers 2

1

I have the following questions and advices for you

  • uninstall all pg gem version in your gemset
  • uninstall pg hero gem
  • run bundle install
  • in case the error still resides then try upgrading the pghero gem - current version is 1.6.2 (mentioning this as your error states pghero)

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.

Sign up to request clarification or add additional context in comments.

Comments

1

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,

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.