"Cache lookup failed for function" when recreating procs - Mailing list pgsql-general

From Chris Fischer
Subject "Cache lookup failed for function" when recreating procs
Date
Msg-id D45F1ECA30B59A4F96208F86532F901F12AA60E8@rdu-caex-01.channeladvisor.com
Whole thread Raw
Responses Re: "Cache lookup failed for function" when recreating procs  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Env: Windows XP sp2
Version: 8.2.1
 
I'm attempting to write a function which produces a script.  The script will contain steps necessary to drop/recreate all the functions.  I've got a helper function called 'dropprocsbyname' which takes a schema and a proc name, finds all matching pg_proc rows and executes 'drop function xyz' on them.
 
So the output of my 'recreate all procs' function looks like this:
 
select * from common.dropprocsbyname('common','proc1');
create or replace function common.proc1() returns bool as
$$body$$
etc
$$body$$
language 'plpgsql' volatile;
 
etc.. for each proc in the common schema.
 
I get many, but not all, errors like this:
 
"psql:e:/pgla_export.txt:1208: ERROR:  cache lookup failed for function 22542
CONTEXT:  PL/pgSQL function "dropprocsbyname" line 23 at execute statement"
 
with the same function oid each time.
 
When I rerun the script, the oid in the error changes.  So, I'm guessing that it has to do with dropping/recreating my "dropprocsbyname" function, but I cannot figure out when its being cached and how to overcome the error.
 

Chris Fischer
Database Engineer

 

pgsql-general by date:

Previous
From: Reece Hart
Date:
Subject: Re: Database deadlock/hanging
Next
From: Tom Lane
Date:
Subject: Re: "Cache lookup failed for function" when recreating procs