Re: Cache lookup failed? - Mailing list pgsql-general

From Tom Lane
Subject Re: Cache lookup failed?
Date
Msg-id 1174.1061241505@sss.pgh.pa.us
Whole thread Raw
In response to Re: Cache lookup failed?  (Jeff Boes <jboes@nexcerpt.com>)
List pgsql-general
Jeff Boes <jboes@nexcerpt.com> writes:
> No, I don't think so. It seems to be pretty consistently happening in
> our homegrown database connection class, as we are executing a query
> against the PG metadata tables. Something like --

> select a.attname, t.typname, a.attlen, a.atttypmod, a.attnotnull,
> a.atthasdef, a.attnum
>               from pg_attribute a,
>                    pg_class     c,
>                    pg_type      t
>               where c.relname  = ?
>                 and a.attrelid = c.oid
>                 and a.attnum  >= 0
>                 and t.oid      = a.atttypid
>                 order by 1

I really do not believe that this query could cause "cache lookup failed
for relation-with-a-large-OID".  The only relations being directly
touched in this query are pg_attribute, pg_class, pg_type, and their
indexes, which will all have small OIDs (less than 20000).  The fact
that you are pulling data that refers to other relations is not relevant
--- it's just data.  The "cache lookup" message could only occur when
the system is trying to access a relation as such, and I see nothing
here that would make it do that for any user relations.

It's too bad you're not running 7.4 ... it'd be really useful to know
exactly which "cache lookup" is failing, but there's no way to get that
info out of 7.3 without a debugger stack trace ...

            regards, tom lane

pgsql-general by date:

Previous
From: Bjørn T Johansen
Date:
Subject: Re: Hour difference?
Next
From: Aaron
Date:
Subject: Re: newbie and no idea