Re: [HACKERS] BUG in 6.5 - GROUP BY inheritance - Mailing list pgsql-hackers

From Chris Bitmead
Subject Re: [HACKERS] BUG in 6.5 - GROUP BY inheritance
Date
Msg-id 37610B58.3CB43151@bigfoot.com
Whole thread Raw
In response to Re: [HACKERS] BUG in 6.5 - GROUP BY inheritance  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [HACKERS] BUG in 6.5 - GROUP BY inheritance
List pgsql-hackers
Ok, I upgraded my CVS sources yesterday, and simple inherited/GROUP BY
queries are working again. But a more complex one still seems broken.
This is the query...




httpd=> SELECT question.oid, question.title, question.summary,
question.datetime, category.oid, category.title, category.image, email,
webuser.name, count(comment.oid) FROM question, webuser,
category*,comment WHERE question.webuser = webuser.oid and
question.category = category.oid AND comment.webobject = question.oid
GROUP BY question.oid, question.title, question.summary,
question.datetime, category.oid, category.title, category.image, email,
webuser.name UNION SELECT question.oid, question.title,
question.summary, question.datetime, category.oid, category.title,
category.image, webuser.email, webuser.name, 0 FROM question, webuser,
category* WHERE question.webuser = webuser.oid and question.category =
category.oid;
ERROR:  replace_vars_with_subplan_refs: variable not in target list


Tom Lane wrote:
> 
> Chris Bitmead <chris.bitmead@bigfoot.com> writes:
> > This is from CVS of about a week ago.
> 
> > SELECT question.title, count(comment.oid) FROM question,
> > category*,comment WHERE comment.webobject = question.oid and
> > question.category = category.oid GROUP BY question.title;
> 
> See my message from Sunday, "inherited GROUP BY is busted":
> 
> : It turns out that pretty much *anything* involving grouping or
> : aggregation would fail if the query used inheritance, because the
> 
> This query seems to work with current sources (although EXPLAIN
> fails for it --- I think that explain.c is out of sync with the
> executor).
> 
>                         regards, tom lane

-- 
Chris Bitmead
mailto:chris@tech.com.au
http://www.techphoto.org - Photography News, Stuff that Matters


pgsql-hackers by date:

Previous
From: Karl DeBisschop
Date:
Subject: Re: [GENERAL] Re: [HACKERS] postgres processes
Next
From: Dmitry Samersoff
Date:
Subject: Client