Re: [GENERAL] cache lookup of relation 165058647 failed - Mailing list pgsql-bugs

From Tom Lane
Subject Re: [GENERAL] cache lookup of relation 165058647 failed
Date
Msg-id 465.1083650123@sss.pgh.pa.us
Whole thread Raw
In response to Re: [GENERAL] cache lookup of relation 165058647 failed  (Sean Chittenden <sean@chittenden.org>)
Responses Re: [GENERAL] cache lookup of relation 165058647 failed
List pgsql-bugs
Sean Chittenden <sean@chittenden.org> writes:
> But, I am suspecting that it's a race condition with the new background
> writer code.

Why?  Have you demonstrated that the failure does not occur in 7.4?

> psql:test-end2.sql:3: ERROR:  cache lookup failed for relation 398033
> CONTEXT:  SQL query "SELECT  TRUE FROM pg_catalog.pg_class c LEFT JOIN
> pg_catalog.pg_namespace n ON n.oid = c.relnamespace WHERE c.relname =
> 'tmptbl'::TEXT AND c.relkind = 'r'::TEXT AND
> pg_catalog.pg_table_is_visible(c.oid)"

I think that pg_table_is_visible() will inspect the catalogs using
SnapshotNow semantics, while the above query will feed it with OIDs that
were valid under a start-of-query snapshot.  So I'd expect failures in
any recent PG version, if tables are being dynamically created/deleted
by concurrent transactions.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Erro
Next
From: Sean Chittenden
Date:
Subject: Re: [GENERAL] cache lookup of relation 165058647 failed