Re: Rewritten queries - Mailing list pgsql-novice

From Tom Lane
Subject Re: Rewritten queries
Date
Msg-id 22066.1104176545@sss.pgh.pa.us
Whole thread Raw
In response to Re: Rewritten queries  (Jaime Casanova <systemguards@yahoo.com>)
Responses Re: Rewritten queries
List pgsql-novice
Jaime Casanova <systemguards@yahoo.com> writes:
> What version of postgres are u using?
> I don't see that particular behavior in coalesce.

> someone knows if this is the behavior in any older
> version of pg?

Yes.  Since about 7.4 COALESCE is a first-class expression node type,
but before that the parser expanded it into a CASE construct.

The CASE implementation is lacking in that it may evaluate the arguments
more than once, which could be wrong if they are volatile values.

            regards, tom lane

pgsql-novice by date:

Previous
From: Jaime Casanova
Date:
Subject: Re: Rewritten queries
Next
From: Jaime Casanova
Date:
Subject: Re: Rewritten queries