X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id C8FE8D9A84 for ; Wed, 28 Sep 2005 14:52:51 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 61806-01 for ; Wed, 28 Sep 2005 17:52:49 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id C0305D9AC5 for ; Wed, 28 Sep 2005 14:52:49 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j8SHqm4u007748; Wed, 28 Sep 2005 13:52:48 -0400 (EDT) To: Ian Meyer Cc: pgsql-sql@postgresql.org Subject: Re: Problem with function and trigger... In-reply-to: References: Comments: In-reply-to Ian Meyer message dated "Wed, 28 Sep 2005 13:35:09 -0400" Date: Wed, 28 Sep 2005 13:52:48 -0400 Message-ID: <7747.1127929968@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 required=5 tests=[AWL=0.006] X-Spam-Level: X-Archive-Number: 200509/282 X-Sequence-Number: 22829 Ian Meyer writes: > IF TG_OP = 'DELETE' AND OLD.deleted = FALSE THEN > ERROR: record "old" is not assigned yet > DETAIL: The tuple structure of a not-yet-assigned record is indeterminate. > CONTEXT: PL/pgSQL function "thread_sync" line 2 at if > What am I failing to understand with this? We don't guarantee short-circuit evaluation of boolean expressions. You'll have to break that into two IFs, ie, IF TG_OP = 'DELETE' THEN IF ... test on OLD.something ... regards, tom lane