queue classic返回PG :: UndefinedColumn:ERROR:column" pid"不存在

时间:2015-02-10 11:07:02

标签: ruby-on-rails postgresql queue-classic

当我这样做时

bundle exec rake qc:work

运行queue_calssic,我收到此错误

rake aborted!
PG::UndefinedColumn: ERROR:  column "pid" does not exist
LINE 1: ..., locked_by = NULL WHERE locked_by NOT IN (SELECT pid FROM p...
                                                             ^
/home/andreas/.rvm/gems/ruby-2.1.1/gems/queue_classic-3.0.3/lib/queue_classic/conn_adapter.rb:18:in `exec'
/home/andreas/.rvm/gems/ruby-2.1.1/gems/queue_classic-3.0.3/lib/queue_classic/conn_adapter.rb:18:in `block in execute'
/home/andreas/.rvm/gems/ruby-2.1.1/gems/queue_classic-3.0.3/lib/queue_classic/conn_adapter.rb:14:in `synchronize'
/home/andreas/.rvm/gems/ruby-2.1.1/gems/queue_classic-3.0.3/lib/queue_classic/conn_adapter.rb:14:in `execute'
/home/andreas/.rvm/gems/ruby-2.1.1/gems/queue_classic-3.0.3/lib/queue_classic.rb:104:in `unlock_jobs_of_dead_workers'
/home/andreas/.rvm/gems/ruby-2.1.1/gems/queue_classic-3.0.3/lib/queue_classic/worker.rb:42:in `start'
/home/andreas/.rvm/gems/ruby-2.1.1/gems/queue_classic-3.0.3/lib/queue_classic/tasks.rb:27:in `block (2 levels) in <top (required)>'
/home/andreas/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
/home/andreas/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => qc:work

当我psql --version时,我得到psql (PostgreSQL) 9.3.5

关于可能出错的任何想法?

1 个答案:

答案 0 :(得分:2)

你有整个查询吗?最重要的部分是缺失,功能或视图在哪里&#34; pid&#34;不存在。狂野猜测:您不使用版本9.3,而是使用版本9.3,使用procpid。 pg_stat_activity在9.2版中更改了此列名

使用此查询获取服务器版本:

SELECT version();

可以通过dump-restorepg_upgrade升级到较新版本。