Sequences, triggers and 'OLD' - am I being stupid? - Mailing list pgsql-novice

From Steve South
Subject Sequences, triggers and 'OLD' - am I being stupid?
Date
Msg-id 001a01c5cb3e$faa49c70$6401a8c0@GROCER
Whole thread Raw
Responses Re: Sequences, triggers and 'OLD' - am I being stupid?
List 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 by date:

Previous
From: Oliver Elphick
Date:
Subject: Re: TEMPORARY TABLE in a PL/pgSQL function
Next
From: Terry Lee Tucker
Date:
Subject: Re: Sequences, triggers and 'OLD' - am I being stupid?