Richard Huxton a écrit :
Alain wrote:
Hello,
System: Red Hat Linux 4 64bits running postgres-7.4.16 (production)
Initial problem:
# pg_dump -O dbname -Ft -f /tmp/database.tar
pg_dump: query to get table columns failed: ERROR: invalid memory
alloc request size 9000688640
After some research, it seems to be related to a corruption of the
database. Running a vacum crashes the db:
-bash-3.00$ vacuumdb -z -a
vacuumdb: vacuuming database "template1"
vacuumdb: vacuuming of database "template1" failed: PANIC: corrupted
item pointer: offset = 3336, size = 20
It would be nice if it's just template1 that is damaged, but I'm not
sure that's the case.
First, thank you Richard and Tom for helping me but I finally decided to
restore the last backup so now, the problem is no longer critical.
Anyway, being able to rescue some datas may be interesting.
The strange point is that the database was running quite well for simple
queries (nothing really visible but no backup possible).
1. Have you had crashes or other hardware problems recently?
No crash but we changed our server (<= seems the cause).
First try was using a file system copy to reduce downtime as it was two
same 7.4.x version but the result was not working (maybe related to
architecture change 32bits => 64 bits) so I finally dropped the db and
performed an dump/restore. I think, the db was a mix of 32/64 bits files.
2. Can you vacuum the other databases?
No.
3. Can you just dump the schema for your selected database with
--schema-only? (your pg_dump seemed to fail fetching column details)
No.
4. Can you dump individual tables with --table=? (it might just be one
table that's damaged)
No.
http://www.postgresql.org/docs/7.4/static/app-pgdump.html
Can someone help me to track down the problem ?
Can I recover the datas (last backup failed) ?
How much can be recovered will depend on what corruption has occurred.
If it's just a damaged index, then reindexing will fix it.
If it's a damaged system catalogue we might be able to fix the catalogue
then read the data.
If data files are damaged we'll need to locate the damage and work
around it. You will probably lose data on any damaged pages.