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

Started by Ian Hardingover 22 years ago2 messagesgeneral
Jump to latest
#1Ian Harding
iharding@tpchd.org

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:

Show quoted text

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

#2Josué Maldonado
josue@lamundial.hn
In reply to: Ian Harding (#1)

Hi Ian,

Ian Harding wrote:

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

No, the column I deleted does not get refered explicitly in the function.

What version are you using?

7.3.3, and I'm planning to upgrade to 7.3.4 later today maybe that can help.

Thanks,