"y.y.chen" <[email protected]> writes:
> When I run SQL -scripts in trigger/PlpgSQL:
> IF (TG_OP = 'INSERT') OR (old.size<>new.size) THEN
> .......
> END IF;
> It raise a exception: RECORD old never be defined,
> while TG_OP is 'INSERT'.
Yup, that's how it works. SQL OR is not guaranteed to be short-circuit
in the same way it is in some programming languages. You need to use
nested IF statements to make this work safely.
regards, tom lane
--
Sent via pgsql-bugs mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs