Fix wrong postgresql query

3 jobs for 104-implement-changes-for-brainstorming in 45 seconds (queued for 3 seconds)