Pgsql conditions do not short circuit?

From: "Guy Rouillier" <guyr(at)masergy(dot)com>
To: "PostgreSQL Interfaces" <pgsql-interfaces(at)postgresql(dot)org>
Subject: Pgsql conditions do not short circuit?
Date: 2005-02-11 00:54:17
Message-ID: CC1CF380F4D70844B01D45982E671B2348E5E5@mtxexch01.add0.masergy.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

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

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Peter Eisentraut 2005-02-11 01:48:41 Re: Pgsql conditions do not short circuit?
Previous Message Tom Lane 2005-02-11 00:35:32 Re: Help with adding C-Language Functions