Re: ORDER BY vs. volatile functions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: ORDER BY vs. volatile functions
Date: 2009-11-16 17:52:35
Message-ID: 22884.1258393955@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk> writes:
> If you try it using nextval(), you'll notice that the function does
> in fact get called twice per row, but one of the results is thrown
> away and replaced with the other one.

Yeah. The problem is that setrefs.c is generating a tlist for the
hashagg node in which both output expressions point to the first
output of the underlying scan node, because it's just relying on
equal() to match up the expressions. I'm testing a fix now ...

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alex Hunsaker 2009-11-16 18:00:33 Re: ALTER TABLE...ALTER COLUMN vs inheritance
Previous Message Andrew Gierth 2009-11-16 17:49:16 Re: ORDER BY vs. volatile functions