From: Bruce Momjian <bruce@momjian.us>
To: Josh Kupershmidt <schmiddy@gmail.com>
Cc: Pavel Stehule <pavel.stehule@gmail.com>
Cc: pgsql-docs <pgsql-docs@postgresql.org>
Subject: Re: [BUGS] documentation bug - behave of NEW a OLD in plpgsql's triggers
Date: Tue, 6 Sep 2011 22:54:39 -0400 (EDT)
Message-ID: <201109070254.p872sd418092@momjian.us> (raw)
In-Reply-To: <BANLkTikzDpBjvUmkoYFWQVPDOdmYX=KFKw@mail.gmail.com>
Josh Kupershmidt wrote:
> [Moving to -docs]
>
> On Mon, May 2, 2011 at 12:00 PM, Pavel Stehule <pavel.stehule@gmail.com> wrote:
> > 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
>
> If I've understood you correctly, the problem is that the docs claim
> that the variables are defined with a value of NULL, when in fact they
> are undefined. For example, if you try to use variable NEW in a delete
> trigger, you'll get an error message like:
> | ERROR: record "new" is not assigned yet
> | DETAIL: The tuple structure of a not-yet-assigned record is indeterminate.
>
> How about a doc tweak like the attached?
Perfect. Applied to 9.0, 9.1, and head. Thanks. Sorry for the delay.
--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ It's impossible for everything to be true. +
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: bruce@momjian.us, schmiddy@gmail.com, pavel.stehule@gmail.com, pgsql-docs@postgresql.org
Subject: Re: [BUGS] documentation bug - behave of NEW a OLD in plpgsql's triggers
In-Reply-To: <201109070254.p872sd418092@momjian.us>
References: <BANLkTikzDpBjvUmkoYFWQVPDOdmYX=KFKw@mail.gmail.com> <201109070254.p872sd418092@momjian.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox