At 23:28 5/08/00 -0400, Tom Lane wrote:
>Philip Warner <pjw@rhyme.com.au> writes:
>>> Well, the standard is perfectly clear, isn't it? If V(1) has side
>>> effects then trying to optimize this into just one evaluation of V(1)
>>> will generate non-spec-compliant results.
>
>> At least with the new function manager, if I feel te need I can write a
>> 'CoalesceValues' function (at least for fixed numbers of parameters).
>
>Mmm ... not really. You could detect nulls all right, but a function-
>based version of COALESCE would evaluate *all* its arguments exactly
>once, which is certainly wrong.
Good point. Although in the specific case (two args, one of them constant),
it's not an issue. I guess I'll just have to live with double-evaluation,
and a COALESCE than can return NULL. Grumble grumble...
----------------------------------------------------------------
Philip Warner | __---_____
Albatross Consulting Pty. Ltd. |----/ - \
(A.C.N. 008 659 498) | /(@) ______---_
Tel: (+61) 0500 83 82 81 | _________ \
Fax: (+61) 0500 83 82 82 | ___________ |
Http://www.rhyme.com.au | / \| | --________--
PGP key available upon request, | /
and from pgp5.ai.mit.edu:11371 |/