Skip site navigation (1) Skip section navigation (2)

Bug #608: cache lookup failed

From: pgsql-bugs(at)postgresql(dot)org
To: pgsql-bugs(at)postgresql(dot)org
Subject: Bug #608: cache lookup failed
Date: 2002-03-06 14:33:10
Message-ID: 20020306143310.8966147654E@postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugs
Laurent Faillie (l_faillie(at)yahoo(dot)com) reports a bug with a severity of 2
The lower the number the more severe it is.

Short Description
cache lookup failed

Long Description
Hi all,

I have just upgraded my 1.7.3 database to 7.2, following documentation's instruction (pg_dumpall + psql < dumpfile).

All is working Ok but a call to an PL/SQL function which fails w/ the following code.

ERROR:  fmgr_info: function 16594: cache lookup failed

I have tryed to drop and recreate this function but it fails again.

I need some help because this problem blocks all my production as most of my application depend on it :-(

I'm working on an HP-UX 11.0 box and postgresql was compiled using GCC 
2.95.3

Thank for your help

- Laurent

Sample Code
CREATE TABLE disk_toppage_stats (
	machine	TEXT,
	jour	DATE,
	pourcent	SMALLINT DEFAULT 0,
	level	SMALLINT DEFAULT	0
);


CREATE FUNCTION upd_disk_toppage_stats() RETURNS text AS '
DECLARE
	res RECORD;
	res2 RECORD;
	res_lmt RECORD;

	nv_vert	CONSTANT SMALLINT := 0;
	nv_jaune CONSTANT SMALLINT := 1;
	nv_rouge CONSTANT SMALLINT := 2;

		-- Default value for levels
	def_lmt_jaune	CONSTANT SMALLINT := 80;
	def_lmt_rouge	CONSTANT SMALLINT := 90;

	lmt_jaune	SMALLINT;
	lmt_rouge	SMALLINT;
	level	SMALLINT;
BEGIN

	FOR res IN select * from disk_toppage_stats LOOP
--		RAISE NOTICE ''machine = %, jour = %'',res.machine,res.jour;

--
--	Update the maximum percentage for each machine.
--
	
		EXECUTE ''UPDATE disk_toppage_stats SET pourcent=(select max(pourcent) FROM disk_space WHERE machine='' || quote_literal(res.machine) || '' AND jour='' || quote_literal(res.jour) || '') WHERE machine='' || quote_literal(res.machine);


-- RAISE NOTICE ''------ machine=% -----'', res.machine;
		level := nv_vert;
		
		FOR res2 IN 
			select * from disk_space 
			where machine=res.machine
			and jour=(select jour from disk_toppage_stats where machine=res.machine)
		LOOP
-- RAISE NOTICE ''fs = %, prc = %'',res2.fs,res2.pourcent;

			lmt_jaune := def_lmt_jaune;
			lmt_rouge := def_lmt_rouge;
			
			SELECT INTO res_lmt * FROM disk_limit
				WHERE machine=res.machine AND fs=res2.fs;
			
			IF FOUND THEN
-- RAISE NOTICE ''****** TROUVE ! ******'';
				lmt_jaune := res_lmt.limite_jaune;
				lmt_rouge := res_lmt.limite_rouge;
			END IF;
			
			IF level = nv_vert THEN
				IF res2.pourcent >= lmt_jaune THEN
					level := nv_jaune;
				END IF;
			END IF;
			
			IF res2.pourcent >= lmt_rouge THEN
				level := nv_rouge;
				EXIT;
			END IF;
		END LOOP;

		EXECUTE ''UPDATE disk_toppage_stats SET level='' || quote_literal(level) || '' WHERE machine='' || quote_literal(res.machine);
--RAISE NOTICE ''on est sortie avec un niveau %'',level;
	END LOOP;

	RETURN ''ok'';
END;

' LANGUAGE 'plpgsql';


No file was uploaded with this report


Responses

pgsql-bugs by date

Next:From: Tom LaneDate: 2002-03-06 18:35:49
Subject: Re: Bug #608: cache lookup failed
Previous:From: Arkadiusz MiskiewiczDate: 2002-03-06 09:18:44
Subject: regression - postgresql 7.2 on power pc/linux

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group