Re: non-deterministic error related to MIN/MAX optimization - Mailing list pgsql-bugs

From Jeff Davis
Subject Re: non-deterministic error related to MIN/MAX optimization
Date
Msg-id 1219772304.6213.238.camel@dell.linuxdev.us.dell.com
Whole thread Raw
In response to Re: non-deterministic error related to MIN/MAX optimization  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: non-deterministic error related to MIN/MAX optimization
List pgsql-bugs
On Tue, 2008-08-26 at 01:04 -0400, Tom Lane wrote:
> Please provide some more detail about those experiments.  The test case
> hasn't been seen to fail in the buildfarm, AFAIR.

Dan Farina, my colleague at Truviso, was experimenting with some query
transformations that pushed the range table entries down into a
subquery.

You can see the effect here:

=> select max(a), generate_series(1,2) as g from foo;
 max | g
-----+---
     | 1
     | 2
(2 rows)

=> -- make "foo" into a subquery and add a no-op
=> -- to prevent it from pulling up the subquery
=> select max(a), generate_series(1,2) as g from (select a as a from foo
offset 0) dummy;
ERROR:  set-valued function called in context that cannot accept a set

So, although Dan's transformations were semantically correct, they ended
up causing this regression failure.

It doesn't have anything to do with the ORDER BY, so that part of my
example was unnecessary.

Regards,
    Jeff Davis

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #4281: some types of errors do not log statements
Next
From: Tom Lane
Date:
Subject: Re: non-deterministic error related to MIN/MAX optimization