[Nitro] Postgres failures in Og test suite.

Kashia Buch kashia at vfemail.net
Thu Apr 6 03:47:35 EDT 2006


On Thu, 06 Apr 2006 08:22:22 +0200, Bryan Soto <bryan.a.soto at gmail.com> wrote:

> Because some of the tickets/patches we have are specifically for the
> Postgres store, I need the test suite running so I know if they break
> things. And so, I begin my new project.
>
> With the postgres join table patch I sent earlier, I get to here.
>
> E, [2006-04-05T22:23:56.328000 #4784] ERROR -- : DB error ERROR:
> column "o.title" must appear in the GROUP BY clause or be used in an
> aggregate function, [
>         SELECT o.*
>         FROM
>           ogglue_tag AS t,
>           ogtestogtaggable_article as o,
>           ogj_glue_tag_testogtaggable_article as j
>         WHERE o.oid = j.article_oid
>           AND t.oid = j.tag_oid
>           AND (t.name in ('navel','gmosx'))
>         GROUP BY j.article_oid
>         HAVING COUNT(j.article_oid) = 2;
>       ]

This must be from taggable, right?...

I remember having to work around a problem there, but I wasn't sure
weither that was the fault of this one or my DB layout.

SELECT * FROM ogquestion
WHERE ogquestion.oid IN (SELECT question_oid
   FROM ogglue_tag JOIN ogj_glue_tag_question
   ON tag_oid = ogglue_tag.oid
   WHERE (ogglue_tag.name IN (#{names})
)
GROUP BY question_oid
HAVING COUNT(question_oid) = #{count});

now... how to integrate that into taggable?

This approach works for me, but I'm not really sure weither this
does exactly the same as the one above (although it should).
It gets all "ogquestion" where the ogquestion oid is in the sub-
query in which the join between the two tag tables happens.
Basically the same as above... (I think), I'm just not good
enough to be able to grok three joins at once it seems ^^;

> Google explained to me that Postgres is a stickler and that it
> requires the o.* fields to be in the group by clause. I don't know
> that we have access to this info in taggable. That'll be the first way
> I try to solve this, but perhaps there is a trick to make this work
> one of you Postgres wizards know?

no wizard here, I can only stick some queries together and make them
work the way I want them to ^^; I wish I had some deeper insight..

I'll work on the cleaned version for taggable, give me an hour or so..

Kashia

-- 
Feel the love
http://pinkjuice.com/pics/ruby.png



More information about the Nitro-general mailing list