Re: documentation bug - behave of NEW a OLD in plpgsql's triggers

Поиск
Список
Период
Сортировка
От Josh Kupershmidt
Тема Re: documentation bug - behave of NEW a OLD in plpgsql's triggers
Дата
Msg-id BANLkTikzDpBjvUmkoYFWQVPDOdmYX=KFKw@mail.gmail.com
обсуждение исходный текст
Ответ на documentation bug - behave of NEW a OLD in plpgsql's triggers  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-bugs
[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?

Josh

Вложения

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Adding a user without expiration date using pgAdmin III causes postgresql Beta1 to crash
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: BUG #6002: French character show garbled