Re: Pgsql conditions do not short circuit? - Mailing list pgsql-interfaces

From Peter Eisentraut
Subject Re: Pgsql conditions do not short circuit?
Date
Msg-id 200502110248.41720.peter_e@gmx.net
Whole thread Raw
In response to Pgsql conditions do not short circuit?  ("Guy Rouillier" <guyr@masergy.com>)
List pgsql-interfaces
Guy Rouillier wrote:
> I have the following condition in a trigger function:
>
>   IF (TG_OP = 'INSERT') OR (TG_OP = 'UPDATE' AND NEW.aggregate_flag
> != OLD.aggregate_flag)
>
> When I cause this trigger to execute on an insert, it complains that
> OLD is not defined yet.  If I reformat this so I check the last
> condition in an IF nested in the "UPDATE" case, it works fine.  From
> this, I'm concluding that pgsql conditions do not short circuit?

That is true, but it wouldn't have helped you anyway, because the error 
is caught during the semantic analysis before the execution phase.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/


pgsql-interfaces by date:

Previous
From: "Guy Rouillier"
Date:
Subject: Pgsql conditions do not short circuit?
Next
From: "Guy Rouillier"
Date:
Subject: Re: Pgsql conditions do not short circuit?