Re: BUG #5025: Aggregate function with subquery in 8.3 and 8.4.

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Sheng Y(dot) Cheng" <scheng(at)adconion(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5025: Aggregate function with subquery in 8.3 and 8.4.
Date: 2009-09-02 11:00:14
Message-ID: 4A9E503E.8050101@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Tom Lane wrote:
> With the fix I was just about to apply, all four cases give the first
> set of results. This clearly satisfies the principle of least
> astonishment, at least more nearly than what we have; but it equally
> clearly is *not* going to restore 8.4 to work just like 8.3.

Right, 8.3 had the same underlying problem, 8.4 just makes it more
visible as it's better at flattening subqueries.

> I'm inclined to apply the patch to 8.4 anyway, because it seems like a
> bug fix. I would consider patching further back except there's no
> chance of making it work in older branches, at least not without
> destabilizing them quite a bit (the PlaceHolderVar mechanism would have
> to be back-ported).
>
> It might be possible to fix the older branches by not flattening
> subqueries that have whole-row references; but even that would take
> nontrivial work, and it'd be sacrificing performance to fix a corner
> case no one has previously complained about. So I'm leaning to patching
> 8.4 and leaving the older branches alone.
>
> Thoughts?

Seems reasonable.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Robert Haas 2009-09-02 13:29:27 Re: BUG #5027: SQL query error?
Previous Message Sam Mason 2009-09-02 09:16:54 Re: BUG #5028: CASE returns ELSE value always when type is "char"