Sequences, triggers and 'OLD' - am I being stupid?

Поиск
Список
Период
Сортировка
От Steve South
Тема Sequences, triggers and 'OLD' - am I being stupid?
Дата
Msg-id 001a01c5cb3e$faa49c70$6401a8c0@GROCER
обсуждение исходный текст
Ответы Re: Sequences, triggers and 'OLD' - am I being stupid?  (Terry Lee Tucker <terry@esc1.com>)
Список pgsql-novice
I'll admit straight away I'm a novice, but this one has me perplexed....

I have a table, T1, with a column (userid) that is an int4 generated from a
sequence.

I have a second table (T2) that I wish to use to hold audited values from
T1.

I have created a trigger function written in PL/PGSQL, set to be for each
row after update on T2, which is supposed to copy the OLD values into T2.

The snag is that when I try to update a row in T1 I get:

ERROR:  record "old" has no field "userid"

This behaviour does not seem to be documented anywhere. Am I just being
dense?

TIA,

Steve S

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.11.13/123 - Release Date: 06/10/2005



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

Предыдущее
От: Oliver Elphick
Дата:
Сообщение: Re: TEMPORARY TABLE in a PL/pgSQL function
Следующее
От: Terry Lee Tucker
Дата:
Сообщение: Re: Sequences, triggers and 'OLD' - am I being stupid?