473,406 Members | 2,343 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

cache lookup of relation 165058647 failed

I have a problem with postgresql tables. periodicaly, I would say
frequently about 5-10 time per hour i have such errors in my server log
file:

2004-04-14 12:23:32 [73692] ERROR: cache lookup of relation 149064743
failed
2004-04-14 12:23:32 [73692] ERROR: Relation "tmp_table1" does not exist
2004-04-14 12:23:32 [73692] ERROR: Relation "tmp_table1" does not exist

So turn on debugging options and have that's what i got:

2004-04-14 12:24:54 [74021] LOG: connection received: host=[local]
2004-04-14 12:24:54 [74021] LOG: connection authorized: user=ejob_guest
database=ejob
2004-04-14 12:24:54 [74021] LOG: query: begin; select
getdatabaseencoding(); commit
2004-04-14 12:24:54 [74021] LOG: duration: 0.000987 sec
2004-04-14 12:24:54 [74021] LOG: query: SELECT d.config_id, d.text1 as
text, d.field_name,
2004-04-14 12:24:54 [74021] LOG: duration: 0.005295 sec
2004-04-14 12:24:54 [74021] LOG: query: CREATE TEMP TABLE tmp_table1 AS
SELECT advert.id, (SELECT employer.fullname FROM employer WHERE
advert.empid=employer.id) as emp_name, (CASE WHEN advert.status1 = 'A'
THEN advert.postname1 ELSE advert.postname2 END) as postname, (SELECT
cd.name FROM catalog_names cd WHERE advert.industry=cd.catalog_id AND
cd.language_id=1) AS f1002, (CASE WHEN status1='A' THEN
advert.obligations1 ELSE advert.obligations2 END) as obligations1 FROM
good_adv as advert
2004-04-14 12:24:54 [74021] ERROR: cache lookup of relation 165058647
failed
2004-04-14 12:24:54 [74021] LOG: query: SELECT * FROM tmp_table1
2004-04-14 12:24:54 [74021] ERROR: Relation "tmp_table1" does not exist
2004-04-14 12:24:54 [74021] LOG: query: SELECT * FROM tmp_table1 ORDER
BY id desc LIMIT 100
2004-04-14 12:24:54 [74021] ERROR: Relation "tmp_table1" does not exist

Does anybody have any idea about what can cause such kind of problems and
how to overcome it ?

Thanks a lot.

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 23 '05 #1
7 2690
On Wednesday 14 April 2004 10:35, Juris Krumins wrote:
2004-04-14 12:24:54 [74021] LOG: query: SELECT d.config_id, d.text1 as
text, d.field_name,
2004-04-14 12:24:54 [74021] LOG: duration: 0.005295 sec
2004-04-14 12:24:54 [74021] LOG: query: CREATE TEMP TABLE tmp_table1 AS
SELECT advert.id, (SELECT employer.fullname FROM employer WHERE
advert.empid=employer.id) as emp_name, (CASE WHEN advert.status1 = 'A'
THEN advert.postname1 ELSE advert.postname2 END) as postname, (SELECT
cd.name FROM catalog_names cd WHERE advert.industry=cd.catalog_id AND
cd.language_id=1) AS f1002, (CASE WHEN status1='A' THEN
advert.obligations1 ELSE advert.obligations2 END) as obligations1 FROM
good_adv as advert
2004-04-14 12:24:54 [74021] ERROR: cache lookup of relation 165058647
failed


The error is complaining about a relation that used to have an OID of
165058647. This is almost certainly a temporary table. Are there any plpgsql
functions referring to a temporary table, or do you create, drop, recreate
tmp_table1 within the same connection?

--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 23 '05 #2

On Wed, 14 Apr 2004, Richard Huxton wrote:
On Wednesday 14 April 2004 10:35, Juris Krumins wrote:
2004-04-14 12:24:54 [74021] LOG: query: SELECT d.config_id, d.text1 as
text, d.field_name,
2004-04-14 12:24:54 [74021] LOG: duration: 0.005295 sec
2004-04-14 12:24:54 [74021] LOG: query: CREATE TEMP TABLE tmp_table1 AS
SELECT advert.id, (SELECT employer.fullname FROM employer WHERE
advert.empid=employer.id) as emp_name, (CASE WHEN advert.status1 = 'A'
THEN advert.postname1 ELSE advert.postname2 END) as postname, (SELECT
cd.name FROM catalog_names cd WHERE advert.industry=cd.catalog_id AND
cd.language_id=1) AS f1002, (CASE WHEN status1='A' THEN
advert.obligations1 ELSE advert.obligations2 END) as obligations1 FROM
good_adv as advert
2004-04-14 12:24:54 [74021] ERROR: cache lookup of relation 165058647
failed


The error is complaining about a relation that used to have an OID of
165058647. This is almost certainly a temporary table. Are there any plpgsql
functions referring to a temporary table, or do you create, drop, recreate
tmp_table1 within the same connection?

--
Richard Huxton
Archonet Ltd

There is actually no creation, droping, recreation of tmp_table1 within
the same connection. The only thing is that good_adv is not actually a
table, but a view. Can it be reason for this problem ?
The second thing is that queries I'v posted before going actually the same
way, first of all create temporary table, then making couple select
queries to that temporary table and that's all. The problem is that i use
such method all over my web site, that's why create temp table tmp_table1
.... are quite large. Coulde it be problem ?

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 23 '05 #3
Richard Huxton <de*@archonet.com> writes:
The error is complaining about a relation that used to have an OID of
165058647. This is almost certainly a temporary table. Are there any plpgsql
functions referring to a temporary table, or do you create, drop, recreate
tmp_table1 within the same connection?


The trace suggests this is happening immediately after connect, so the
last part doesn't sound right. It could be a plpgsql function problem,
though the query doesn't look like it invokes any functions.

What I was wondering about was dangling references within a view, that
is a view referring to a table that no longer exists. (That shouldn't
happen anymore in 7.3 and later, but if this is a pre-7.3 system then
it's possible.) Does this query make use of any views, and if so do the
views change from time to time?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 23 '05 #4
On Wed, 14 Apr 2004, Tom Lane wrote:
Richard Huxton <de*@archonet.com> writes:
The error is complaining about a relation that used to have an OID of
165058647. This is almost certainly a temporary table. Are there any plpgsql
functions referring to a temporary table, or do you create, drop, recreate
tmp_table1 within the same connection?


The trace suggests this is happening immediately after connect, so the
last part doesn't sound right. It could be a plpgsql function problem,
though the query doesn't look like it invokes any functions.

What I was wondering about was dangling references within a view, that
is a view referring to a table that no longer exists. (That shouldn't
happen anymore in 7.3 and later, but if this is a pre-7.3 system then
it's possible.) Does this query make use of any views, and if so do the
views change from time to time?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html


Sorry i didn't mention my version. It is PostgreSQL 7.3.4. As I metioned
there is no function invocted from that query.

The view I use to make temporary table was made by query:

SELECT advert.id, advert.status1, advert.empid, advert.email,
advert.postname1, advert.postname2, advert.industry,
advert.obligations1, advert.obligations2, advert.chk_edu, advert.chk_lang,
advert.chk_compskills, advert.chk_work, advert.chk_travel
, advert.chk_drivlic, advert.chk_auto, advert.chk_worktime,
advert.chk_workarea, advert.edu_deg, advert.travel, advert.lica, advert.
licb, advert.licc, advert.licd, advert.lice, advert.auto,
advert.aquirement1, advert.aquirement2, advert.offer1, advert.offer2, adve
rt.fut_all_time, advert.salary1, advert.address1, advert."location",
advert.work_time1, advert.work_time2, advert.person1, advert.pe
rson2, advert.personpost1, advert.personpost2, advert.phone, advert.fax,
advert.web, advert.address2, advert.salary2, advert.time_cr
eate, advert.enddate, advert.status2, advert.send_email FROM advert,
employer WHERE (((((advert.empid = employer.id) AND (employer.s
tatus <> 'B'::bpchar)) AND (employer.act_lidz >=
date("timestamp"('today'::text)))) AND (employer.act_no <=
date("timestamp"('today'
::text)))) AND ((advert.enddate >= date("timestamp"('today'::text))) AND
((advert.status1 = 'A'::bpchar) OR (advert.status2 = 'A'::b
pchar))));

So there is no mucj information you can get out of this, but the only
thing is true, that information in view change from time to time.
I'v checked everything conected with nonexistent tables and things like
that. Everything looks fine.

Diging through the source coude reveals me that:

src/backend/catalog/dependency.c: elog(ERROR, "cache lookup
of relation %u failed", relid);
src/backend/catalog/heap.c: elog(ERROR, "cache lookup of
relation %u failed",
src/backend/catalog/pg_constraint.c:
elog(ERROR, "cache lookup of relation %u failed",);
src/backend/utils/adt/ruleutils.c: elog(ERROR, "cache lookup
of relation %u failed", relid);

So bacicaly we have only 4 places, which cane generate errors like that,
and all this places refer to HeapTupleIsValid function.
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 23 '05 #5
Juris Krumins <ju*****@komin.lv> writes:
So bacicaly we have only 4 places, which cane generate errors like that,
and all this places refer to HeapTupleIsValid function.


Hmm. What's even more interesting is that none of them are in places
that I would expect to be called during a CREATE TABLE AS operation.
Can you dig into it a bit more and find out which one is failing?
A stack trace back from the error would be useful too.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 23 '05 #6

I'v find out that this error occurs in:
dependency.c file

2004-04-26 11:09:34 ERROR: dependency.c 1621: cache lookup of relation
149064743 failed
2004-04-26 11:09:34 ERROR: Relation "tmp_table1" does not exist
2004-04-26 11:09:34 ERROR: Relation "tmp_table1" does not exist

in getRelationDescription(StringInfo buffer, Oid relid) function.

Any ideas what can cause this errors.

On Wed, 14 Apr 2004, Tom Lane wrote:
Richard Huxton <de*@archonet.com> writes:
The error is complaining about a relation that used to have an OID of
165058647. This is almost certainly a temporary table. Are there any plpgsql
functions referring to a temporary table, or do you create, drop, recreate
tmp_table1 within the same connection?


The trace suggests this is happening immediately after connect, so the
last part doesn't sound right. It could be a plpgsql function problem,
though the query doesn't look like it invokes any functions.

What I was wondering about was dangling references within a view, that
is a view referring to a table that no longer exists. (That shouldn't
happen anymore in 7.3 and later, but if this is a pre-7.3 system then
it's possible.) Does this query make use of any views, and if so do the
views change from time to time?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 23 '05 #7

I'v find out that this error occurs in:
dependency.c file

2004-04-26 11:09:34 ERROR: dependency.c 1621: cache lookup of relation
149064743 failed
2004-04-26 11:09:34 ERROR: Relation "tmp_table1" does not exist
2004-04-26 11:09:34 ERROR: Relation "tmp_table1" does not exist

in getRelationDescription(StringInfo buffer, Oid relid) function.

Any ideas what can cause this errors.

On Wed, 14 Apr 2004, Tom Lane wrote:
Richard Huxton <de*@archonet.com> writes:
The error is complaining about a relation that used to have an OID of
165058647. This is almost certainly a temporary table. Are there any plpgsql
functions referring to a temporary table, or do you create, drop, recreate
tmp_table1 within the same connection?


The trace suggests this is happening immediately after connect, so the
last part doesn't sound right. It could be a plpgsql function problem,
though the query doesn't look like it invokes any functions.

What I was wondering about was dangling references within a view, that
is a view referring to a table that no longer exists. (That shouldn't
happen anymore in 7.3 and later, but if this is a pre-7.3 system then
it's possible.) Does this query make use of any views, and if so do the
views change from time to time?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 23 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jeff Boes | last post by:
What might be the source of this error? Cache lookup failed for relation 188485009 We've been getting these at odd intervals, and they are not reproducible. Our setup: PostgreSQL 7.3.3...
0
by: culley harrelson | last post by:
I am getting this error: fmgr_info: function 7390843: cache lookup failed when trying to insert some data into a table using the tsearch2 contrib module (this is postgresql 7.3). I have the...
1
by: Együd Csaba | last post by:
Hi All, I run into an error message. I have the following function where t_stockchanges is one of my tables. -------------------------------------------- create or replace function...
3
by: google | last post by:
I have a database with four table. In one of the tables, I use about five lookup fields to get populate their dropdown list. I have read that lookup fields are really bad and may cause problems...
4
by: Paul | last post by:
Hi, When should I use a list (in table properties: like Ford;Mercedes;BMW;Audi ) and when should I use a lookup table?? And second question: IF I use a lookup table, should I always make a...
3
by: dbuchanan | last post by:
Hello, (Windows forms - SQL Server) I fill my datagrid with a stored procedure that includes relationships to lookup tables so that users can see the values of the combobox selections rather...
10
by: Razvan Surdulescu | last post by:
After I restore a Postgres database (using pg_restore), I get the following error message when I try to run a simple UPDATE query: ERROR: cache lookup failed for function 70529 More details:...
8
by: Mark Gibson | last post by:
Hello, I've just encountered a problem that I don't know how to deal with. After having a play with SlonyI, I dropped the entire slony cluster schema, and then tried to drop a schema which held...
9
by: Michael M. | last post by:
Hi all, I would like to know how to access the NT/2000/XP/2003 Name cache; what I mean by this is: Open a Command Prompt and.., C:\> C:\>IPCONFIG /DISPLAYDNS
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.