From: Peter Eisentraut <peter_e@gmx.net>
To: Guy Rouillier <guyr@masergy.com>
Cc: PostgreSQL Interfaces <pgsql-interfaces@postgresql.org>
Subject: Re: Pgsql conditions do not short circuit?
Date: Fri, 11 Feb 2005 02:48:41 +0100
Message-ID: <200502110248.41720.peter_e@gmx.net> (raw)
In-Reply-To: <CC1CF380F4D70844B01D45982E671B2348E5E5@mtxexch01.add0.masergy.com>
References: <CC1CF380F4D70844B01D45982E671B2348E5E5@mtxexch01.add0.masergy.com>
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/
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: peter_e@gmx.net, guyr@masergy.com
Subject: Re: Pgsql conditions do not short circuit?
In-Reply-To: <200502110248.41720.peter_e@gmx.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox