Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 2FA881337BE1 for ; Mon, 2 May 2011 13:24:53 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 36829-02-4 for ; Mon, 2 May 2011 16:24:44 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-iw0-f174.google.com (mail-iw0-f174.google.com [209.85.214.174]) by mail.postgresql.org (Postfix) with ESMTP id 9BD831337FA2 for ; Mon, 2 May 2011 13:01:28 -0300 (ADT) Received: by iwn34 with SMTP id 34so4754676iwn.19 for ; Mon, 02 May 2011 09:01:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:from:date:message-id:subject:to :content-type; bh=x6q0KBHLcAXHM2Eq7KOXiZnW0S2QZ6kqG49vxOtycbM=; b=UbnOntFfMoHtPgI9TEOVAYaaOfnLvD71xG1TRNLJFST/dTvWmnQ+EiGlqzWdHNnrsG wqqcU8xFgR76tnKNFKWg/kQifcSWqshGoNpEvemHzGWBDIqhs5B//18R0ECm5qNNPcKS MPk88MRDjXrkdOuAT25qAhnfT0S4xRmNWr8FY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=CXgNo9bJ7dnUT4YPrbGpTrThoCMk6C1+/i3RIV5zdBkKQO/TOoR39QDjS+3RrRhJmB KUGdriDnG+XXAHAcYKoC30srCffyG9+92pa+BIWfdMjolmES0eQadSn3xZCnHeP1Y9Mo wN4R3lII27pQPWB5oRuS+o5QYkrvmzglqH4Wo= Received: by 10.43.54.193 with SMTP id vv1mr524773icb.338.1304352088085; Mon, 02 May 2011 09:01:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.42.165.70 with HTTP; Mon, 2 May 2011 09:00:48 -0700 (PDT) From: Pavel Stehule Date: Mon, 2 May 2011 18:00:48 +0200 Message-ID: Subject: documentation bug - behave of NEW a OLD in plpgsql's triggers To: pgsql-bugs@postgresql.org Content-Type: text/plain; charset=UTF-8 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.888 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RFC_ABUSE_POST=0.001, T_TO_NO_BRKTS_FREEMAIL=0.01 X-Spam-Level: X-Archive-Number: 201105/3 X-Sequence-Number: 30142 Hello one czech user reported a bug in documentation - http://www.postgresql.org/docs/8.4/static/plpgsql-trigger.html NEW Data type RECORD; variable holding the new database row for INSERT/UPDATE operations in row-level triggers. This variable is NULL in statement-level triggers and for DELETE operations. OLD Data type RECORD; variable holding the old database row for UPDATE/DELETE operations in row-level triggers. This variable is NULL in statement-level triggers and for INSERT operations. It isn't correct. NEW is not declared in DELETE trigger, OLD isn't declared in INSERT Regards Pavel Stehule