"Cache lookup failed for function" when recreating procs

Поиск
Список
Период
Сортировка
От Chris Fischer
Тема "Cache lookup failed for function" when recreating procs
Дата
Msg-id D45F1ECA30B59A4F96208F86532F901F12AA60E8@rdu-caex-01.channeladvisor.com
обсуждение исходный текст
Ответы Re: "Cache lookup failed for function" when recreating procs  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Reece Hart
Дата:
Сообщение: Re: Database deadlock/hanging
Следующее
От: Tom Lane
Дата:
Сообщение: Re: "Cache lookup failed for function" when recreating procs