Thread: cache lookup failed ???? What is it ???!!!

cache lookup failed ???? What is it ???!!!

From
"J.Fernando Moyano"
Date:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



I can't execute this SQL query:  DELETE FROM piezas WHERE ord_mec = '01-001'
I get:  ERROR: fmgr_info: function 39816: cache lookup failed

Can someone help me with this error ??

******************************************************

CREATE TABLE piezas (
n_pieza        INTEGER PRIMARY KEY,n_material    INTEGER NOT NULL,ord_mec    VARCHAR(8) NOT NULL,
t_inicio                TIMESTAMP DEFAULT 'invalid',t_final        TIMESTAMP DEFAULT 'invalid',
ref_eisenor    VARCHAR(32),ref_cliente    VARCHAR(32),           n_plano        VARCHAR(32),
n_lote        VARCHAR(8),
observaciones    VARCHAR(256),
FOREIGN KEY (n_material) REFERENCES materia_prima(n_material),FOREIGN KEY (ord_mec) REFERENCES ord_mecanizado(ord_mec)
);


CREATE TABLE materia_prima (
n_material    INTEGER PRIMARY KEY,fecha        DATE NOT NULL DEFAULT 'today',n_albaran    INTEGER,n_pedido_mp
INTEGER,n_lote       VARCHAR(8),
 
cantidad    INTEGER,usadas        INTEGER DEFAULT '0' CHECK (usadas>=0 AND usadas<=cantidad),torcidas_plano    INTEGER
DEFAULT'0' CHECK (torcidas_plano>=0 AND 
 
torcidas_plano<=cantidad),torcidas_canto    INTEGER DEFAULT '0' CHECK (torcidas_canto>=0 AND 
torcidas_canto<=cantidad),
dim_ancho    FLOAT,dim_alto    FLOAT,dim_largo    FLOAT,material    VARCHAR(32),pc_C        FLOAT,
observaciones    VARCHAR(256)

);


CREATE FUNCTION materia_prima_release_one() RETURNS OPAQUE AS 'BEGIN UPDATE materia_prima SET usadas=usadas-1 WHERE
n_material= OLD.n_material; RETURN OLD;END;'
 
LANGUAGE 'plpgsql';

CREATE TRIGGER piezas_delete AFTER DELETE ON piezasFOR EACH ROW EXECUTE PROCEDURE materia_prima_release_one();


- -- 
Fernando Moyano

Frase del día:
- --------------
Si las mujeres fueran buenas, Dios tendria una.

(*) SymeX ==> http://symex.lantik.com
(*) WDBIL ==> http://wdbil.sourceforge.net
(*) Informate sobre LINUX en http://www.linux.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE7M7RPoZaf9MvtDvcRApqgAJ9tQjdcd6ACuvWMDrFXR2erAIlfOQCgoyBk
TJhAno7UmoZfD/CUxvnMLpM=
=HDIQ
-----END PGP SIGNATURE-----


Re: cache lookup failed ???? What is it ???!!!

From
Peter Eisentraut
Date:
J.Fernando Moyano writes:

> I can't execute this SQL query:  DELETE FROM piezas WHERE ord_mec = '01-001'
> I get:  ERROR: fmgr_info: function 39816: cache lookup failed

You dropped the function that is referenced by the trigger and recreated
one by the same name.  The system keeps track of functions by oid, not by
name, so the trigger doesn't find the function anymore.  Solution:  Drop
and re-create the trigger.

-- 
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter