473,796 Members | 2,621 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Cache lookup failure for pg_restore?

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=webcli ent [dbname] > database.backup

2. I restore the database:

dropdb -U postgres [dbname]
createdb -U postgres [dbname]
createlang -U postgres plpgsql [dbname]
pg_restore -v -U postgres -Fc -d [dbname] database.backup

3. I connect to the database and run a query:

$ psql cspan webclient
Welcome to psql 7.4, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help on internal slash commands
\g or terminate with semicolon to execute query
\q to quit

cspan=> update contact set gender = 'M';
ERROR: cache lookup failed for function 70529

If I re-run the update, I get:

cspan=> update contact set gender = 'M';
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.
!>

Any ideas what might be happening here? This is all running on a
RedHat linux box. The original database (before backup/restore) works
fine. The database has a few GIST (full-search, tsearch2) indices, but
otherwise is pretty ordinary.

Thanks in advance for any insight,

Razvan.
Nov 23 '05 #1
10 3554
su******@yahoo. com (Razvan Surdulescu) writes:
cspan=> update contact set gender = 'M';
ERROR: cache lookup failed for function 70529 If I re-run the update, I get: cspan=> update contact set gender = 'M';
server closed the connection unexpectedly
Hm, could we see the full schema for the "contact" table?
The database has a few GIST (full-search, tsearch2) indices, but
otherwise is pretty ordinary.


Any of those on "contact"?

What would be useful to look at is a debugger stack trace from the core
dump...

Also it might be worth your time to update to 7.4.2, just to see if this
is an already-fixed bug.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 23 '05 #2
su******@yahoo. com (Razvan Surdulescu) writes:
cspan=> update contact set gender = 'M';
ERROR: cache lookup failed for function 70529 If I re-run the update, I get: cspan=> update contact set gender = 'M';
server closed the connection unexpectedly
Hm, could we see the full schema for the "contact" table?
The database has a few GIST (full-search, tsearch2) indices, but
otherwise is pretty ordinary.


Any of those on "contact"?

What would be useful to look at is a debugger stack trace from the core
dump...

Also it might be worth your time to update to 7.4.2, just to see if this
is an already-fixed bug.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 23 '05 #3

Tom Lane wrote:
su******@yahoo. com (Razvan Surdulescu) writes:
cspan=> update contact set gender = 'M';
ERROR: cache lookup failed for function 70529
If I re-run the update, I get:

cspan=> update contact set gender = 'M';
server closed the connection unexpectedly


Hm, could we see the full schema for the "contact" table?


Sure, I copy/pasted it at the end of the message: it's a bit long.
The database has a few GIST (full-search, tsearch2) indices, but
otherwise is pretty ordinary.


Any of those on "contact"?


Yes, one of them, see the contact schema below.
What would be useful to look at is a debugger stack trace from the core
dump...
Hmm, I cannot find a core file from the crash. I looked in the
postgres/bin directory and in the current directory, but no luck.
Also it might be worth your time to update to 7.4.2, just to see if this
is an already-fixed bug.


I will look into that, but it would be non-trivial, I am hoping that
this bug might be faster to resolve without upgrading? Perhaps there is
something I am doing wrong with the backup or restore process?

Thanks,

Razvan.

CREATE TABLE contact (
id serial NOT NULL,
member_id integer NOT NULL REFERENCES member(id),
member_contact bool NOT NULL default false,
uploaded bool NOT NULL default false,
private bool NOT NULL default true,

nametitle varchar(5),
firstname varchar(50) NOT NULL,
middlename varchar(50),
lastname varchar(50) NOT NULL,
suffix varchar(10),
gender varchar(7),

profheadline varchar(255),
summary varchar(255),
announs varchar(255),
assmemb varchar(255),
appkeywords varchar(255),

street1 varchar(255),
street2 varchar(255),
city varchar(50),
state varchar(50),
zip varchar(15),
country varchar(50),

cellphone varchar(20),
busphone1 varchar(20),
busphone2 varchar(20),
busfax varchar(20),
asstphone varchar(20),
pager varchar(20),

email varchar(80) NOT NULL,

highschool varchar(255),
college varchar(255),
colldegree varchar(255),
gradschool varchar(255),
graddegree varchar(255),

homephone varchar(20),
homecity varchar(50),
homestate varchar(50),
homecountry varchar(50),
lang1 varchar(25),
lang2 varchar(25),
lang3 varchar(25),
lang4 varchar(25),
interests varchar (255),
georgs varchar(255),

keywords text,

-- This is the full text index field.
-- It is updated by the trigger below.
keywordsFTI tsvector,

PRIMARY KEY (id)
);

CREATE INDEX idx_contact_mem ber_id ON contact(member_ id);

CREATE INDEX idx_keywordsFTI ON contact USING gist(keywordsFT I);

CREATE TRIGGER tsvectorupdate BEFORE UPDATE OR INSERT ON contact
FOR EACH ROW EXECUTE PROCEDURE tsearch2(keywor dsFTI, keywords);

Nov 23 '05 #4

Tom Lane wrote:
su******@yahoo. com (Razvan Surdulescu) writes:
cspan=> update contact set gender = 'M';
ERROR: cache lookup failed for function 70529
If I re-run the update, I get:

cspan=> update contact set gender = 'M';
server closed the connection unexpectedly


Hm, could we see the full schema for the "contact" table?


Sure, I copy/pasted it at the end of the message: it's a bit long.
The database has a few GIST (full-search, tsearch2) indices, but
otherwise is pretty ordinary.


Any of those on "contact"?


Yes, one of them, see the contact schema below.
What would be useful to look at is a debugger stack trace from the core
dump...
Hmm, I cannot find a core file from the crash. I looked in the
postgres/bin directory and in the current directory, but no luck.
Also it might be worth your time to update to 7.4.2, just to see if this
is an already-fixed bug.


I will look into that, but it would be non-trivial, I am hoping that
this bug might be faster to resolve without upgrading? Perhaps there is
something I am doing wrong with the backup or restore process?

Thanks,

Razvan.

CREATE TABLE contact (
id serial NOT NULL,
member_id integer NOT NULL REFERENCES member(id),
member_contact bool NOT NULL default false,
uploaded bool NOT NULL default false,
private bool NOT NULL default true,

nametitle varchar(5),
firstname varchar(50) NOT NULL,
middlename varchar(50),
lastname varchar(50) NOT NULL,
suffix varchar(10),
gender varchar(7),

profheadline varchar(255),
summary varchar(255),
announs varchar(255),
assmemb varchar(255),
appkeywords varchar(255),

street1 varchar(255),
street2 varchar(255),
city varchar(50),
state varchar(50),
zip varchar(15),
country varchar(50),

cellphone varchar(20),
busphone1 varchar(20),
busphone2 varchar(20),
busfax varchar(20),
asstphone varchar(20),
pager varchar(20),

email varchar(80) NOT NULL,

highschool varchar(255),
college varchar(255),
colldegree varchar(255),
gradschool varchar(255),
graddegree varchar(255),

homephone varchar(20),
homecity varchar(50),
homestate varchar(50),
homecountry varchar(50),
lang1 varchar(25),
lang2 varchar(25),
lang3 varchar(25),
lang4 varchar(25),
interests varchar (255),
georgs varchar(255),

keywords text,

-- This is the full text index field.
-- It is updated by the trigger below.
keywordsFTI tsvector,

PRIMARY KEY (id)
);

CREATE INDEX idx_contact_mem ber_id ON contact(member_ id);

CREATE INDEX idx_keywordsFTI ON contact USING gist(keywordsFT I);

CREATE TRIGGER tsvectorupdate BEFORE UPDATE OR INSERT ON contact
FOR EACH ROW EXECUTE PROCEDURE tsearch2(keywor dsFTI, keywords);

Nov 23 '05 #5
Razvan Surdulescu <su******@yahoo .com> writes:
cspan=> update contact set gender = 'M';
ERROR: cache lookup failed for function 70529
The database has a few GIST (full-search, tsearch2) indices, but
otherwise is pretty ordinary.
Any of those on "contact"?
Yes, one of them, see the contact schema below.
I recall some discussion recently about the FTI code getting confused
with this sort of symptom resulting; you might want to check the
archives.
What would be useful to look at is a debugger stack trace from the core
dump... Hmm, I cannot find a core file from the crash. I looked in the
postgres/bin directory and in the current directory, but no luck.
The core would be in $PGDATA/base/yourdbOID/. If you don't see one,
it's likely because the postmaster is being started under "ulimit -c 0".
Restart it with "ulimit -c unlimited" and reproduce the problem and
you should get a core.
Also it might be worth your time to update to 7.4.2, just to see if this
is an already-fixed bug.

I will look into that, but it would be non-trivial,


Shouldn't be; you won't have to dump and reload, just install new
software and restart postmaster. It's only cross-major-version updates
that are painful.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #6

Tom Lane wrote:
Razvan Surdulescu <su******@yahoo .com> writes:
cspan=> update contact set gender = 'M';
ERROR: cache lookup failed for function 70529
The database has a few GIST (full-search, tsearch2) indices, but
otherwise is pretty ordinary.Any of those on "contact"?
Yes, one of them, see the contact schema below.


I recall some discussion recently about the FTI code getting confused
with this sort of symptom resulting; you might want to check the
archives.


OK, I will look in the archives. Do you have some specific keywords I
should search for?
What would be useful to look at is a debugger stack trace from the core
dump...
Hmm, I cannot find a core file from the crash. I looked in the
postgres/bin directory and in the current directory, but no luck.


The core would be in $PGDATA/base/yourdbOID/. If you don't see one,
it's likely because the postmaster is being started under "ulimit -c 0".
Restart it with "ulimit -c unlimited" and reproduce the problem and
you should get a core.


I got the core, thanks, see the gdb output below.
Also it might be worth your time to update to 7.4.2, just to see if this
is an already-fixed bug.

I will look into that, but it would be non-trivial,


Shouldn't be; you won't have to dump and reload, just install new
software and restart postmaster. It's only cross-major-version updates
that are painful.


Thanks, I will look into that as well.

Razvan.

$ gdb ../../../bin/postmaster core.3080
GNU gdb 6.1
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...Using host libthread_db
library "/lib/tls/libthread_db.so .1".

Core was generated by `postgres: webclient testrestore [local] UPDATE '.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/lib/libz.so.1...don e.
Loaded symbols for /usr/lib/libz.so.1
Reading symbols from /usr/lib/libreadline.so. 4...done.
Loaded symbols for /usr/lib/libreadline.so. 4
Reading symbols from /lib/libtermcap.so.2 ...done.
Loaded symbols for /lib/libtermcap.so.2
Reading symbols from /lib/libcrypt.so.1.. .done.
Loaded symbols for /lib/libcrypt.so.1
Reading symbols from /lib/libresolv.so.2. ..done.
Loaded symbols for /lib/libresolv.so.2
Reading symbols from /lib/libnsl.so.1...d one.
Loaded symbols for /lib/libnsl.so.1
Reading symbols from /lib/libdl.so.2...do ne.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /lib/tls/libm.so.6...don e.
Loaded symbols for /lib/tls/libm.so.6
Reading symbols from /lib/tls/libc.so.6...don e.
Loaded symbols for /lib/tls/libc.so.6
Reading symbols from /lib/ld-linux.so.2...do ne.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from /lib/libnss_files.so .2...done.
Loaded symbols for /lib/libnss_files.so .2
Reading symbols from /cspan/sandbox/postgresql/lib/tsearch2.so...d one.
Loaded symbols for /cspan/sandbox/postgresql/lib/tsearch2.so
#0 0x00000000 in ?? ()
(gdb) where
#0 0x00000000 in ?? ()
#1 0x081a7cfe in FunctionCall2 ()
#2 0x40d424c0 in parsetext_v2 ()
from /cspan/sandbox/postgresql/lib/tsearch2.so
#3 0x40d44eb4 in tsearch2 () from /cspan/sandbox/postgresql/lib/tsearch2.so
#4 0x080dc7fb in ExecCallTrigger Func ()
#5 0x080dd079 in ExecBRUpdateTri ggers ()
#6 0x080ed111 in ExecUpdate ()
#7 0x080eca7d in ExecutePlan ()
#8 0x080ebe52 in ExecutorRun ()
#9 0x0814d82e in ProcessQuery ()
#10 0x0814e168 in PortalRunMulti ()
#11 0x0814dc04 in PortalRun ()
#12 0x0814af14 in exec_simple_que ry ()
#13 0x0814cf7c in PostgresMain ()
#14 0x0812d127 in BackendFork ()
#15 0x0812cc1a in BackendStartup ()
#16 0x0812b54b in ServerLoop ()
#17 0x0812af2b in PostmasterMain ()
#18 0x08102d2c in main ()
(gdb)

Nov 23 '05 #7

Tom Lane wrote:
Razvan Surdulescu <su******@yahoo .com> writes:
cspan=> update contact set gender = 'M';
ERROR: cache lookup failed for function 70529
The database has a few GIST (full-search, tsearch2) indices, but
otherwise is pretty ordinary.Any of those on "contact"?
Yes, one of them, see the contact schema below.


I recall some discussion recently about the FTI code getting confused
with this sort of symptom resulting; you might want to check the
archives.


I did some searches for:

"cache lookup failed" full text index
"cache lookup failed" fti
"cache lookup failed for function"

but I couldn't find anything recent and/or similar to the problem I
encountered below.

Am I searching for the right thing?
Also it might be worth your time to update to 7.4.2, just to see if this
is an already-fixed bug.

I will look into that, but it would be non-trivial,


Shouldn't be; you won't have to dump and reload, just install new
software and restart postmaster. It's only cross-major-version updates
that are painful.


I upgraded to 7.4.2, no luck: same problem/stack trace.

Razvan.

Nov 23 '05 #8
I don't know if this is any help, but if I create the database and
schema by hand and just restore the data into it, everything works fine.
However, if I let the backup script both create the database and restore
the schema and data, the bug manifests itself.

Perhaps it is some sort of ordering problem in the auto-generated
restore script?

Razvan.

Tom Lane wrote:
Razvan Surdulescu <su******@yahoo .com> writes:
cspan=> update contact set gender = 'M';
ERROR: cache lookup failed for function 70529
The database has a few GIST (full-search, tsearch2) indices, but
otherwise is pretty ordinary.
Any of those on "contact"?
Yes, one of them, see the contact schema below.

I recall some discussion recently about the FTI code getting confused
with this sort of symptom resulting; you might want to check the
archives.

What would be useful to look at is a debugger stack trace from the core
dump...
Hmm, I cannot find a core file from the crash. I looked in the
postgres/bin directory and in the current directory, but no luck.

The core would be in $PGDATA/base/yourdbOID/. If you don't see one,
it's likely because the postmaster is being started under "ulimit -c 0".
Restart it with "ulimit -c unlimited" and reproduce the problem and
you should get a core.

Also it might be worth your time to update to 7.4.2, just to see if this
is an already-fixed bug.


I will look into that, but it would be non-trivial,

Shouldn't be; you won't have to dump and reload, just install new
software and restart postmaster. It's only cross-major-version updates
that are painful.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend


Nov 23 '05 #9
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Razvan Surdulescu wrote:

| 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

Hi Razvan,

Just to add to what Tom has already said, this is most certainly because
of your tsearch/gist usage. Check the Tsearch2 site [1] for a lot of
interesting documentation on Tsearch2.
For a quite nice howto on backups and restores of databases with
Tsearch2 see the Tsearch2 Intro document [2]

There is actually now a patch [3] to tsearch (only for 7.4 though) which
is supposed to improve dumping and reloading of tsearch2 databases.

[1] http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2/
[2]
http://www.sai.msu.su/~megera/postgr...-V2-intro.html
[3]
http://www.sai.msu.su/~megera/postgr...e_7.4.patch.gz

Best Regards
- --
Denis
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2-nr2 (Windows XP)

iD8DBQFAniUSvsC A6eRGOOARAtJpAK Ct4Wcrea3bIxu8f Xw/5ZNFACdohwCfZPD f
UuCk1dXLx8SCS4/qMniC2z4=
=871m
-----END PGP SIGNATURE-----

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #10

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

Similar topics

0
2099
by: Joshua D. Drake | last post by:
Alright, we are testing pg_restore while restoring a 7GB database. This database has about 6GB of large objects and about 1Gb of textual data. The problem has been verified on PostgreSQL 7.3.2, PostgreSQL 7.3.3 and Mammoth PostgreSQL 7.3.4 . The command being used to backup the data is: /usr/local/pgsql/bin/pg_dump dominion -h localhost --superuser=postgres --create --format=c -b -o -f /backups/backup.sql.tar.gz The command has also...
14
3720
by: Ron Johnson | last post by:
Hi, While on the topic of "need for in-place upgrades", I got to think- ing how the pg_restore could be speeded up. Am I wrong in saying that in the current pg_restore, all of the indexes are created in serial? How about this new, multi-threaded way of doing the pg_restore: 0. On the command line, you specify how many threads you want.
7
2743
by: Juris Krumins | last post by:
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 ERROR: cache lookup of relation 149064743 failed 2004-04-14 12:23:32 ERROR: Relation "tmp_table1" does not exist 2004-04-14 12:23:32 ERROR: Relation "tmp_table1" does not exist So turn on debugging options and have that's what i got:
0
364
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
3
4921
by: Sven Willenberger | last post by:
Created a pg_dump with Fc (custom format compression) that resulted in a 300+MB file. Now trying to pg_restore this thing fails with either an out of memory error (as in the subject line) on FreeBSD 4.10-STABLE or a: pg_restore in malloc(): error: allocation failed Abort (core dumped) error on FreeBSD 5.2.1-P9 (RELEASE) In both cases I have increased the max data segment size to 1.5GB and the max stack size to 768M or so.
7
7770
by: Tim Penhey | last post by:
Maybe it's just me, but I can't seem to get pg_restore to restore a database... I am running 8.0 beta 2 (using the dev3 installer) on Windows XP. I created a very simple database with one table and one function and dumped it out using: pg_dump -U postgres -F c -f test.dump test
1
10238
by: ruben | last post by:
Hi: I'm trying to dump tableA and restore it to tableB: $ ./pg_dump -Fc -t tableA databaseA -f tableA.dump -v $ ./pg_restore -t tableB -d databaseA tableA.dump -v pg_dump creates tableA.dump aparently well, but after running pg_restore without errors I cannot find any "tableB", what am I doing wrong?
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
4
1431
by: MonkeeSage | last post by:
Proposal: When an attribute lookup fails for an object, check the top-level (and local scope?) for a corresponding function or attribute and apply it as the called attribute if found, drop through to the exception otherwise. This is just syntactic sugar. Example:
0
9685
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
9531
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10459
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
10237
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...
0
10018
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...
1
7553
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6795
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();...
1
4120
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2928
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.