Thread: Re: How to recover from : "Cache lookup failed for rela

Re: How to recover from : "Cache lookup failed for rela

From
Patrick.FICHE@AQSACOM.COM
Date:
alis=# select * from pg_depend where objid in ( 463558, 463559 ) or refobjid
in ( 463558, 463559 );
 classid | objid  | objsubid | refclassid | refobjid | refobjsubid | deptype

---------+--------+----------+------------+----------+-------------+--------
-
    1247 | 463559 |        0 |       1259 |   463558 |           0 | i
    1259 | 463558 |        0 |      16672 |   440012 |           0 | n
(2 rows)

alis=# select oid, * from pg_namespace where nspname = 'pg_temp_4';
  oid   |  nspname  | nspowner | nspacl
--------+-----------+----------+--------
 440012 | pg_temp_4 |        1 |
(1 row)

alis=# select * from pg_depend where refobjid = 440012;
 classid | objid  | objsubid | refclassid | refobjid | refobjsubid | deptype

---------+--------+----------+------------+----------+-------------+--------
-
    1259 | 463558 |        0 |      16672 |   440012 |           0 | n

----------------------------------------------------------------------------
---------------
Patrick Fiche
email : patrick.fiche@aqsacom.com
tél : 01 69 29 36 18
----------------------------------------------------------------------------
---------------




-----Original Message-----
From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
Sent: lundi 23 mai 2005 16:08
To: Patrick.FICHE@AQSACOM.COM
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] How to recover from : "Cache lookup failed for
rela tion "


Patrick.FICHE@AQSACOM.COM writes:
> The error happens when I try to create other temporary tables.
> Here is a part of my Server Log :

> ERROR:  cache lookup failed for relation 463558
> CONTEXT:  SQL statement "CREATE TEMP TABLE Tmp_MsgRxOrder ( EventId int4,
> CodeRef int4 )"
>         PL/pgSQL function "adm_ne" line 248 at SQL statement
> STATEMENT:  SELECT ALIS.ADM_NE()

This must be happening when you first try to use the pg_temp_4 schema
inside a particular session.  The code will try to remove the existing
schema contents (as indicated by pg_depend), and evidently there is
something inconsistent in that.

What rows do you have in pg_depend that have either objid or refobjid
equal to 463558 or 463559?  Also, get the OID of the pg_temp_4 schema
from pg_namespace, and see what rows in pg_depend have refobjid equal
to that.

            regards, tom lane

Re: How to recover from : "Cache lookup failed for rela tion "

From
Tom Lane
Date:
Patrick.FICHE@AQSACOM.COM writes:
>  classid | objid  | objsubid | refclassid | refobjid | refobjsubid | deptype

> ---------+--------+----------+------------+----------+-------------+--------
> -
>     1247 | 463559 |        0 |       1259 |   463558 |           0 | i
>     1259 | 463558 |        0 |      16672 |   440012 |           0 | n
> (2 rows)

Well, what I'd recommend is to manually delete those two rows in
pg_depend and then delete the row in pg_type.  This may not clean things
up 100% but it should be close enough.

            regards, tom lane