Re: TCL trigger doesn't work after deleting a column

From: Ian Harding <iharding(at)tpchd(dot)org>
To: Josué Maldonado <josue(at)lamundial(dot)hn>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: TCL trigger doesn't work after deleting a column
Date: 2003-09-03 13:44:06
Message-ID: 3F55F026.9000804@tpchd.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

It seems to work for me...
create table foobar (
col1 varchar,
col2 varchar)
;

create function testfunc() returns trigger language pltcl as '

foreach id [array names NEW] {
elog NOTICE $NEW($id)
}
';

create trigger testtrig after insert or update on foobar for each row
execute procedure testfunc();

crap=# insert into foobar values ('asdf', 'asdf');
NOTICE: asdf
NOTICE: asdf
INSERT 191088282 1
crap=# alter table foobar drop column col1;
ALTER TABLE
crap=# insert into foobar values ('asdf');
NOTICE: asdf
INSERT 191088394 1

Is the column you deleted one that you referred explicitly by name in
your function?

What version are you using?

Josué Maldonado wrote:

> Hello list,
>
> The TCL trigger that uses NEW and OLD arrays failed after after I
> removed a unused column, now I got this error:
>
> pltcl: Cache lookup for attribute '........pg.dropped.24........' type
> 0 failed
>
> I already did a vacuum, but the error remain. Any idea how to
> fix/avoid that?
>
> Thanks in advance
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2003-09-03 13:56:13 Re: Trunc in Postgres
Previous Message Paul Thomas 2003-09-03 13:34:03 Re: Tomcat Connection Pool?