This project is archived and is in readonly mode.
with_scope and :group option fails for PostgreSQL
-
Nicolas Alejandro Santa
Here is an explanation about what is happening.
http://e-haitham.blogspot.com/2008/12/mysql-vs-postgresql-key-diffe...
-
Santiago Pastorino
- State changed from new to open
- Tag changed from 2.3, activerecord, bug to 23, activerecord, bug
This issue has been automatically marked as stale because it has not been commented on for at least three months.
The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.
Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.
-
Santiago Pastorino
- State changed from open to stale
-
Martin Caetano
I'm having the same problem when deploying to Heroku.
Query is:
@conversations = Conversation.all(:conditions => ["user_id = ? or friend_id = ?", @conversation.user_id, @conversation.user_id], :group => "friend_id", :order => "created_at desc")
And the error I get from console
ActiveRecord::StatementInvalid (PGError: ERROR: column "conversations.id" must appear in the GROUP BY clause or be used in an aggregate function
: SELECT "conversations".* FROM "conversations" WHERE (user_id = 1 or friend_id = 1) GROUP BY friend_id ORDER BY created_at desc): -
Martin Caetano
Here there's more info about how PosgreSQL handles group by
http://stackoverflow.com/questions/4599010/heroku-postgresql-group-...
-
joson
A Replica Breitling is a timepiece of high quality and functionality and you will have all the class, prestige and luxury of a wealthy, successful individual. By choosing from our selection of luxury Replica Watches , you can improve your self-esteem and feel confident to enter new circles of business associates and friends. These Rolex Replicas will surely enhance your style and only you will know the watch you wear did not cost you $1,000's of dollars.
