Re: non-deterministic error related to MIN/MAX optimization

From: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Jeff Davis" <pgsql(at)j-davis(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: non-deterministic error related to MIN/MAX optimization
Date: 2008-08-26 19:37:34
Message-ID: 162867790808261237p749b90a0k60f8d17af4850b5b@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

2008/8/26 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
> Jeff Davis <pgsql(at)j-davis(dot)com> writes:
>> => -- 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.
>
> Hmm ... after a bit of poking at it, the reason it's failing is that Agg
> plan nodes don't support SRFs in their targetlists. (Group nodes don't
> either.) Kind of interesting that no one ever complained about that
> before ... although given that plpgsql SRFs don't work in targetlists
> anyway, maybe it's been masked for common uses.
>
> I'm not entirely sure if we should add SRF support to Agg/Group or just
> write it off as being a deprecated feature anyhow. Given the
> definitional issues involved with multiple SRFs in the same targetlist,
> putting more effort into the feature doesn't seem like a great
> investment of time.

I dislike this feature - sometime we can do nice hack with it, but
it's very dificult readable.

regards
Pavel Stehule

>
> regards, tom lane
>
> --
> Sent via pgsql-bugs mailing list (pgsql-bugs(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-bugs
>

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message tcook 2008-08-26 20:07:45 BUG #4377: casting result of timeofday() to timestamp fails in some timezones
Previous Message Tom Lane 2008-08-26 18:19:58 Re: non-deterministic error related to MIN/MAX optimization