Skip to content

ActiveRecord::StatementInvalid - PSQL - "people with more than one submission" #554

@elad-eyal

Description

@elad-eyal

When clicking Reports --> Query Speakers --> people with more than one submission

if the database is PostgreSQL

You get


  PG::GroupingError: ERROR:  column "people.id" must appear in the GROUP BY clause or be used in an aggregate function LINE 1: SELECT DISTINCT "people".* FROM "people" INNER JOIN "event_p...
                        ^
: SELECT DISTINCT "people".* FROM "people" INNER JOIN "event_people" ON "event_people"."person_id" = "people"."id" INNER JOIN "events" ON "events"."id" = "event_people"."event_id" INNER JOIN "conferences" ON "conferences"."id" = "events"."conference_id" WHERE "conferences"."id" = $1 AND "event_people"."event_role" = $2 GROUP BY event_people.person_id HAVING (count(*) > 1)
  app/controllers/reports_controller.rb:121:in `show_people'

It works OK with sqlite3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions