Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postgres error while adding multiple choice question #26

Closed
Sjors opened this issue Aug 2, 2014 · 3 comments
Closed

Postgres error while adding multiple choice question #26

Sjors opened this issue Aug 2, 2014 · 3 comments

Comments

@Sjors
Copy link

Sjors commented Aug 2, 2014

When I try to add a multiple choice question to a survey I get the following error message:

ActiveRecord::StatementInvalid (PG::GroupingError: ERROR:  column "answers.id" must appear in the GROUP BY clause or be used in an aggregate function
LINE 1: SELECT "answers".* FROM "answers"  WHERE "answers"."question...
               ^
: SELECT "answers".* FROM "answers"  WHERE "answers"."question_id" = $1 GROUP BY text  ORDER BY display_order, display_order DESC

Using Ruby 2.1.2, Rails 4.0.8, pg 0.17.1 and Postgres 9.3.1 on OSX Mavericks.

I don't get this error when I use SQLite.

@kjayma
Copy link
Owner

kjayma commented Aug 2, 2014

I'll take a look - thanks for the info.

@kjayma
Copy link
Owner

kjayma commented Aug 2, 2014

Able to reproduce problem. Will get you a fix.

@kjayma kjayma closed this as completed in 9e8d70b Aug 2, 2014
@kjayma
Copy link
Owner

kjayma commented Aug 2, 2014

Should fix this error. Gem will generally work with postgres, but you may run into some other problems. It broke a couple of my tests, which I am working to get green again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants