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




---------------------------(end of broadcast)--------------------------- TIP 8: explain analyze is your friend

Reply via email to