ERROR: pltcl: Cache lookup for attribute

Поиск
Список
Период
Сортировка
Искать

ERROR: pltcl: Cache lookup for attribute

От:
Rob Fielding <rob@dsvr.net>
Дата:
Hi,
I have a general table logging function and a generic log and edits 
table pair attached to all the tables I want to log changes with.

So therefore I have one generic function, called by multiple triggers, 
each of which glue instancies of TABLE to a log/edits pair.

The trigger is set on the insert/update events, as you'd expect.

The function is written in TCL and interogates the NEW and OLD arrays.

One of the tables has just been modified, and the following error is 
returned whenever an update is made :

ERROR:  pltcl: Cache lookup for attribute '........pg.dropped.5........' 
type 0 failed

I've dropped the trigger off this table and reattached it, but this 
didn't work. I'm hesitant to drop the function the trigger is based on 
because that's going to break every other instance of this trigger.

I am also hesitant to do create or replace function incase this screws 
up all the other triggers.

Fortunately for me, I've pulled a copy off this live site onto my 
workstation. I didn't preserve OID's, so gave it a fresh start. I 
performed the same table modification, and the trigger still works fine 
:/. Perhaps something like OID order due to the age of the function and 
table? I duno, but I've seen it in the past (7.1/7.2 days) where PG 
doesn't like you fussing with tables and triggers and functions - but I 
never tried to figure out why.

I would prefer to update the on-line db without taking it down and 
replacing it with a freshly pg_dumped version.

Is it possible to 'fix' any of the pg_ tables by hand to solve this 
cache lookup error?

The master DB is 7.3.4, the version on my workstation is 7.3.2.

If it's not possible, I'll have to do a dump and restore, which is a bit 
of sledge hammer fix imo.

Cheers for any insight.

-- 

Rob Fielding
rob@dsvr.net

www.dsvr.co.uk              Development             Designer Servers Ltd

Re: ERROR: pltcl: Cache lookup for attribute

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Rob Fielding  writes:
> One of the tables has just been modified, and the following error is 
> returned whenever an update is made :
> ERROR:  pltcl: Cache lookup for attribute '........pg.dropped.5........' 
> type 0 failed

7.3 pltcl had some bugs in dealing with dropped columns.  If you aren't
in a position to update to 7.4 yet, you could try applying this patch
locally:

http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/pl/tcl/pltcl.c.diff?r1=1.76&r2=1.77

			regards, tom lane
FAQ