pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Re: cache lookup failed ???? What is it ???!!!
2+ messages / 2 participants
[nested] [flat]

* Re: cache lookup failed ???? What is it ???!!!
@ 2001-06-22 16:56  Peter Eisentraut <peter_e@gmx.net>
  parent: J.Fernando Moyano <txinete@wanadoo.es>
  0 siblings, 0 replies; 2+ messages in thread

From: Peter Eisentraut @ 2001-06-22 16:56 UTC (permalink / raw)
  To: J.Fernando Moyano <txinete@wanadoo.es>; +Cc: pgsql-sql

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




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* cache lookup failed ???? What is it ???!!!
@ 2001-06-22 21:10  J.Fernando Moyano <txinete@wanadoo.es>
  0 siblings, 1 reply; 2+ messages in thread

From: J.Fernando Moyano @ 2001-06-22 21:10 UTC (permalink / raw)
  To: pgsql-sql

-----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 piezas
 FOR 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-----



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2001-06-22 21:10 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-06-22 21:10 cache lookup failed ???? What is it ???!!! J.Fernando Moyano <txinete@wanadoo.es>
2001-06-22 16:56 ` Peter Eisentraut <peter_e@gmx.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox