Actions
Bug #939
closedInvalid PostgreSQL statement in 0.3rc2
Description
I upgraded to 0.3rc2 and am now getting the following in the logs whenever I try and bring up the web page:
Processing HostsController#index (for 161.210.45.73 at 2011-05-24 13:09:28) [GET] Parameters: {"action"=>"index", "controller"=>"hosts"} ActiveRecord::StatementInvalid (PGError: ERROR: column "hosts.name" must appear in the GROUP BY clause or be used in an aggregate function LINE 1: SELECT * FROM "hosts" GROUP BY hosts.id ORDER BY "hosts"."n... ^ : SELECT * FROM "hosts" GROUP BY hosts.id ORDER BY "hosts"."name" ASC LIMIT 20 OFFSET 0): app/controllers/hosts_controller.rb:37:in `index' app/controllers/hosts_controller.rb:35:in `index' /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' /usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' /usr/lib/ruby/1.8/webrick/server.rb:162:in `start' /usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' /usr/lib/ruby/1.8/webrick/server.rb:95:in `start' /usr/lib/ruby/1.8/webrick/server.rb:92:in `each' /usr/lib/ruby/1.8/webrick/server.rb:92:in `start' /usr/lib/ruby/1.8/webrick/server.rb:23:in `start' /usr/lib/ruby/1.8/webrick/server.rb:82:in `start' Rendering /usr/share/foreman/public/500.html (500 Internal Server Error)
I'm using PostgreSQL 9.0.4 as my database.
Updated by Ohad Levy over 13 years ago
- Assignee changed from Ohad Levy to Amos Benari
- Target version set to 0.3
more info on the matter can be found here: http://stackoverflow.com/questions/1769361/postgresql-group-by-different-from-mysql
a quick workaround might be to remove the group by statement in app/controllers/hosts_controller.rb at line 30
e.g.
search = my_hosts.search_for(params[:search],:order => params[:order])
Updated by Jeffrey Ollie over 13 years ago
Thanks for the quick workaround, that does get me up and running again! Let me know if there's any additional information you need to get a final solution.
Updated by Ohad Levy over 13 years ago
- Status changed from New to Ready For Testing
- % Done changed from 0 to 100
Applied in changeset 2a5a7f60d12d3694dd20272d30727abb86471212.
Updated by Ohad Levy over 13 years ago
- Status changed from Ready For Testing to Closed
Actions