logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

Pgsql conditions do not short circuit?: msg#00042

Subject: Pgsql conditions do not short circuit?
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?

-- 
Guy Rouillier


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster



<Prev in Thread] Current Thread [Next in Thread>