postgress fail on sql query
from @jck2 in #1347
I'm having the same error with 2.2.1 on heroku. The relevant log is:
2013-03-08T03:43:49+00:00 heroku[router]: at=info method=GET path=/projects.autocomplete?term=a host=jcktracks.herokuapp.com fwd="198.21.234.82" dyno=web.1 queue=0 wait=3ms connect=7ms service=60ms status=200 bytes=33
2013-03-08T03:43:49+00:00 app[web.1]: Processing by ProjectsController#index as AUTOCOMPLETE
2013-03-08T03:43:49+00:00 app[web.1]: Rendered text template (0.0ms)
2013-03-08T03:43:49+00:00 app[web.1]: Parameters: {"term"=>"a"}
2013-03-08T03:43:49+00:00 app[web.1]: Completed 200 OK in 36ms (Views: 0.9ms | ActiveRecord: 17.7ms)
2013-03-08T03:43:49+00:00 heroku[router]: at=info method=GET path=/assets/images/ui-bg_gloss-wave_70_ffdd57_500x100.png host=jcktracks.herokuapp.com fwd="198.21.234.82" dyno=web.1 queue=0 wait=1ms connect=2ms service=10ms status=304 bytes=0
2013-03-08T03:44:02+00:00 app[web.1]: Started GET "/contexts.autocomplete?term=a" for 198.21.234.82 at 2013-03-08 03:44:02 +0000
2013-03-08T03:44:02+00:00 app[web.1]:
2013-03-08T03:44:02+00:00 app[web.1]: ActiveRecord::StatementInvalid (PG::Error: ERROR: column "contexts.id" must appear in the GROUP BY clause or be used in an aggregate function
2013-03-08T03:44:02+00:00 app[web.1]: ^
2013-03-08T03:44:02+00:00 app[web.1]: LINE 1: SELECT contexts.*, count(todos.id) as todos_count FROM "cont...
2013-03-08T03:44:02+00:00 app[web.1]: : SELECT contexts.*, count(todos.id) as todos_count FROM "contexts" left outer join todos on context_id=contexts.id WHERE "contexts"."user_id" = 1 GROUP BY context_id ORDER BY position ASC):
2013-03-08T03:44:02+00:00 app[web.1]: app/controllers/contexts_controller.rb:16:in `index'
2013-03-08T03:44:02+00:00 app[web.1]: app/controllers/contexts_controller.rb:243:in `block in render_autocomplete'
2013-03-08T03:44:02+00:00 heroku[router]: at=info method=GET path=/contexts.autocomplete?term=a host=jcktracks.herokuapp.com fwd="198.21.234.82" dyno=web.1 queue=0 wait=0ms connect=1ms service=29ms status=500 bytes=752
Autocomplete works fine for projects.
I'm having the same error with 2.2.1 on heroku. The relevant log is:
2013-03-08T03:43:49+00:00 heroku[router]: at=info method=GET path=/projects.autocomplete?term=a host=jcktracks.herokuapp.com fwd="198.21.234.82" dyno=web.1 queue=0 wait=3ms connect=7ms service=60ms status=200 bytes=33
2013-03-08T03:43:49+00:00 app[web.1]: Processing by ProjectsController#index as AUTOCOMPLETE
2013-03-08T03:43:49+00:00 app[web.1]: Rendered text template (0.0ms)
2013-03-08T03:43:49+00:00 app[web.1]: Parameters: {"term"=>"a"}
2013-03-08T03:43:49+00:00 app[web.1]: Completed 200 OK in 36ms (Views: 0.9ms | ActiveRecord: 17.7ms)
2013-03-08T03:43:49+00:00 heroku[router]: at=info method=GET path=/assets/images/ui-bg_gloss-wave_70_ffdd57_500x100.png host=jcktracks.herokuapp.com fwd="198.21.234.82" dyno=web.1 queue=0 wait=1ms connect=2ms service=10ms status=304 bytes=0
2013-03-08T03:44:02+00:00 app[web.1]: Started GET "/contexts.autocomplete?term=a" for 198.21.234.82 at 2013-03-08 03:44:02 +0000
2013-03-08T03:44:02+00:00 app[web.1]:
2013-03-08T03:44:02+00:00 app[web.1]: ActiveRecord::StatementInvalid (PG::Error: ERROR: column "contexts.id" must appear in the GROUP BY clause or be used in an aggregate function
2013-03-08T03:44:02+00:00 app[web.1]: ^
2013-03-08T03:44:02+00:00 app[web.1]: LINE 1: SELECT contexts.*, count(todos.id) as todos_count FROM "cont...
2013-03-08T03:44:02+00:00 app[web.1]: : SELECT contexts.*, count(todos.id) as todos_count FROM "contexts" left outer join todos on context_id=contexts.id WHERE "contexts"."user_id" = 1 GROUP BY context_id ORDER BY position ASC):
2013-03-08T03:44:02+00:00 app[web.1]: app/controllers/contexts_controller.rb:16:in `index'
2013-03-08T03:44:02+00:00 app[web.1]: app/controllers/contexts_controller.rb:243:in `block in render_autocomplete'
2013-03-08T03:44:02+00:00 heroku[router]: at=info method=GET path=/contexts.autocomplete?term=a host=jcktracks.herokuapp.com fwd="198.21.234.82" dyno=web.1 queue=0 wait=0ms connect=1ms service=29ms status=500 bytes=752
Autocomplete works fine for projects.
Leave a comment
on 2013-03-17 08:55 *
By zoombody
Assigned to set to zoombody
Status changed from New to Fixed
Assigned to set to zoombody
Status changed from New to Fixed
(In tracks-tickets:cc81cfd8794f9d54f0411c0bc88cf54868b24a81) Use default context sort order when returning autocomplete
Fixes #1403
Branch: 2.2_branch
Fixes #1403
Branch: 2.2_branch
(In tracks-tickets:b1f54e68b8679ab79d80c280b71641402ee352ef) Use default context sort order when returning autocomplete
Fixes #1403
Branch: master
Fixes #1403
Branch: master