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
{{ message }}
Repository navigation
ActiveRecord::StatementInvalid when sorting by the "Arguments" column #28
PG::UndefinedFunction: ERROR: could not identify an ordering operator for type json
LINE 1: ...assic_jobs".* FROM "queue_classic_jobs" ORDER BY args desc ...
^
HINT: Use an explicit ordering operator or modify the query.
: SELECT "queue_classic_jobs".* FROM "queue_classic_jobs" ORDER BY args desc NULLS LAST LIMIT 50 OFFSET 0
Rendered /home/abe/.gem/ruby/2.1.5/gems/queue_classic_admin-0.2.0/app/views/queue_classic_admin/shared/_job_list.html.erb (13.1ms)
Rendered /home/abe/.gem/ruby/2.1.5/gems/queue_classic_admin-0.2.0/app/views/queue_classic_admin/queue_classic_jobs/index.html.erb within layouts/queue_classic_admin/application (14.5ms)
Completed 500 Internal Server Error in 20ms
Ah, right...not sure what is the solution to that.
Some history for you. args used to be a text column (in Rails's language) but is now json for newly created projects. It works fine in text though, which is still the case for "older" applications.
Thoughts? Maybe we could detect the column type, and based on that have different behavior? Maybe there is a way to cast that into string then do the sort of it?
I personally never faced that, but it would make sense to fix it somehow while keeping it as-is for people with and args column of type text.
Ah, gotcha. Might be simplest to just take the sort off of that column completely, since the actual data can be completely arbitrary based on whatever the end user is passing to their job classes, right? In newer Postgreses you can slice and dice the JSON structure but that doesn't do you any good if you can't predict the structure ahead of time. Up to you folks though.
Activity
jipiboily commentedon Jan 15, 2015
Ah, right...not sure what is the solution to that.
Some history for you.
argsused to be atextcolumn (in Rails's language) but is now json for newly created projects. It works fine in text though, which is still the case for "older" applications.Thoughts? Maybe we could detect the column type, and based on that have different behavior? Maybe there is a way to cast that into string then do the sort of it?
I personally never faced that, but it would make sense to fix it somehow while keeping it as-is for people with and
argscolumn of typetext.abevoelker commentedon Jan 15, 2015
Ah, gotcha. Might be simplest to just take the sort off of that column completely, since the actual data can be completely arbitrary based on whatever the end user is passing to their job classes, right? In newer Postgreses you can slice and dice the JSON structure but that doesn't do you any good if you can't predict the structure ahead of time. Up to you folks though.
jipiboily commentedon Jan 16, 2015
@smatthieu @ukd1 are you sorting by args ever?
jipiboily commentedon Jan 16, 2015
Hrm..
@smathieu
smathieu commentedon Jan 16, 2015
No. Removing the sort column for this makes the most sense I think.
jipiboily commentedon Jan 16, 2015
👍