473,785 Members | 2,290 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
getdatabaseenco ding(); 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.fullna me FROM employer WHERE
advert.empid=em ployer.id) as emp_name, (CASE WHEN advert.status1 = 'A'
THEN advert.postname 1 ELSE advert.postname 2 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.obligati ons1 ELSE advert.obligati ons2 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 2740
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.fullna me FROM employer WHERE
advert.empid=em ployer.id) as emp_name, (CASE WHEN advert.status1 = 'A'
THEN advert.postname 1 ELSE advert.postname 2 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.obligati ons1 ELSE advert.obligati ons2 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.fullna me FROM employer WHERE
advert.empid=em ployer.id) as emp_name, (CASE WHEN advert.status1 = 'A'
THEN advert.postname 1 ELSE advert.postname 2 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.obligati ons1 ELSE advert.obligati ons2 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.c om> 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.c om> 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.postname 1, advert.postname 2, advert.industry ,
advert.obligati ons1, advert.obligati ons2, advert.chk_edu, advert.chk_lang ,
advert.chk_comp skills, advert.chk_work , advert.chk_trav el
, advert.chk_driv lic, advert.chk_auto , advert.chk_work time,
advert.chk_work area, advert.edu_deg, advert.travel, advert.lica, advert.
licb, advert.licc, advert.licd, advert.lice, advert.auto,
advert.aquireme nt1, advert.aquireme nt2, advert.offer1, advert.offer2, adve
rt.fut_all_time , advert.salary1, advert.address1 , advert."locatio n",
advert.work_tim e1, advert.work_tim e2, advert.person1, advert.pe
rson2, advert.personpo st1, advert.personpo st2, advert.phone, advert.fax,
advert.web, advert.address2 , advert.salary2, advert.time_cr
eate, advert.enddate, advert.status2, advert.send_ema il FROM advert,
employer WHERE (((((advert.emp id = employer.id) AND (employer.s
tatus <> 'B'::bpchar)) AND (employer.act_l idz >=
date("timestamp "('today'::text )))) AND (employer.act_n o <=
date("timestamp "('today'
::text)))) AND ((advert.enddat e >= date("timestamp "('today'::text ))) AND
((advert.status 1 = '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 HeapTupleIsVali d 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 HeapTupleIsVali d 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 getRelationDesc ription(StringI nfo buffer, Oid relid) function.

Any ideas what can cause this errors.

On Wed, 14 Apr 2004, Tom Lane wrote:
Richard Huxton <de*@archonet.c om> 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*******@postg resql.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 getRelationDesc ription(StringI nfo buffer, Oid relid) function.

Any ideas what can cause this errors.

On Wed, 14 Apr 2004, Tom Lane wrote:
Richard Huxton <de*@archonet.c om> 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*******@postg resql.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
12597
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 Red Hat 7.3
0
1554
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 following trigger defined: BEGIN NEW.search_vector := setweight(to_tsvector(coalesce(NEW.display_text, '')), 'A') ||
1
2630
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 get_last_open(int, int) returns setof t_stockchanges AS ' declare ProductID alias for $1; StockID alias for $2;
3
10667
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 that are hard to find. The main problem I am having right now is that I have a report that is sorted by one of these lookup fields and it only displays the record's ID number. When I add the source table to the query it makes several records...
4
2059
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 relation (1-to-many) in my relation scheme? Any help is greatly appreciated, I'm a bit puzzled.
3
2291
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 than the key value that are stored in the table. It works well if the comboboxes are selected when the row is created.
10
3551
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: 1. I backup the database: pg_dump -Fc --username=webclient > database.backup
8
12706
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 some slave tables for the slony cluster. I kept getting the following error: ERROR: cache lookup failed for relation 4667548
9
2577
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
9646
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10350
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10157
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10097
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9957
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8983
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6742
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5386
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5518
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.