Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id D2C5A1337BE9 for ; Fri, 6 May 2011 00:33:13 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 30221-02 for ; Fri, 6 May 2011 03:32:56 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id A96FD1337BC4 for ; Fri, 6 May 2011 00:32:55 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p463WsGo001928; Thu, 5 May 2011 23:32:54 -0400 (EDT) To: Josh Kupershmidt cc: Pavel Stehule , pgsql-docs Subject: Re: [BUGS] documentation bug - behave of NEW a OLD in plpgsql's triggers In-reply-to: References: <1102.1304649395@sss.pgh.pa.us> Comments: In-reply-to Josh Kupershmidt message dated "Thu, 05 May 2011 22:58:24 -0400" Date: Thu, 05 May 2011 23:32:54 -0400 Message-ID: <1927.1304652774@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201105/17 X-Sequence-Number: 6692 Josh Kupershmidt writes: > Hrm, guess I learned something. I tested with a trigger function which used: > ... > IF NEW IS NULL THEN > RAISE NOTICE 'new is null.'; > ... > which was giving me 'ERROR: record "new" is not assigned yet' when > used as an on-delete trigger. Hmm ... I wonder whether we couldn't make that case work, since IS NULL shouldn't particularly care whether the record has a known tuple structure or not. Still, it's probably not worth spending effort on ... regards, tom lane