Re: ORDER BY vs. volatile functions - Mailing list pgsql-hackers

From Tom Lane
Subject Re: ORDER BY vs. volatile functions
Date
Msg-id 22884.1258393955@sss.pgh.pa.us
Whole thread Raw
In response to Re: ORDER BY vs. volatile functions  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
List pgsql-hackers
Andrew Gierth <andrew@tao11.riddles.org.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


pgsql-hackers by date:

Previous
From: Andrew Gierth
Date:
Subject: Re: ORDER BY vs. volatile functions
Next
From: Alex Hunsaker
Date:
Subject: Re: ALTER TABLE...ALTER COLUMN vs inheritance