>>>>> "Tom" == Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
>> For bonus weirdness:
>> select distinct random(),random() from generate_series(1,10);
>> set enable_hashagg=off;
>> select distinct random(),random() from generate_series(1,10);
>> I think _that_ one is a bug.
Tom> Hmm. I think the first one is a bug --- the two invocations of
Tom> random() in the tlist shouldn't be folded together.
That's what I meant.
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.
--
Andrew.