From 84d80af1ce6da885897b794f2941ee93ce547b10 Mon Sep 17 00:00:00 2001 From: Thomas Keller Date: Wed, 18 Apr 2012 23:00:37 +0200 Subject: [PATCH] Postgres seems to need every column in the group by, not only the PK. --- src/IDF/Tag.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/IDF/Tag.php b/src/IDF/Tag.php index a996b4a..ee127ec 100644 --- a/src/IDF/Tag.php +++ b/src/IDF/Tag.php @@ -76,13 +76,14 @@ class IDF_Tag extends Pluf_Model ); $table = $this->_con->pfx.'idf_project_idf_tag_assoc'; + $cols = implode(', ', array_keys($this->_a['cols'])); $this->_a['views'] = array( 'join_projects' => array( 'join' => 'LEFT JOIN '.$table .' ON idf_tag_id=id', 'select' => $this->getSelect().',COUNT(idf_project_id) as project_count', - 'group' => 'id', + 'group' => $cols, 'props' => array('project_count' => 'project_count'), ), );