shortcircuit logic in plpsql - Mailing list pgsql-general

From Joseph Shraibman
Subject shortcircuit logic in plpsql
Date
Msg-id e9k7va$lrg$1@news.hub.org
Whole thread Raw
Responses Re: shortcircuit logic in plpsql  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
I'm trying to do this:

  IF TG_OP = \'INSERT\' OR (TG_OP = \'UPDATE\' AND OLD.status <>
NEW.status) THEN

..but pg is complaining:

ERROR:  record "old" is not assigned yet
DETAIL:  The tuple structure of a not-yet-assigned record is indeterminate.
CONTEXT:  PL/pgSQL function "set_dir_count" line 4 at if

Does plpgsql not short circuit its logic?

=>select version();
                                                  version
---------------------------------------------------------------------------------------------------------
  PostgreSQL 8.0.8 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.2.2
20030222 (Red Hat Linux 3.2.2-5)
(1 row)

pgsql-general by date:

Previous
From: Q
Date:
Subject: Re: Antw: Performance problem with query
Next
From: Tom Lane
Date:
Subject: Re: shortcircuit logic in plpsql