pg_dump: Error message from server: ERROR: compressed data is corrupt

pg_dump: Error message from server: ERROR: compressed data is corrupt

am 23.04.2010 13:54:42 von Achilleus Mantzios

Hello,
just coming back from a rescue marathon on this remote server i was telling=
you.
As i said, the last problem was while doing a=20
pg_dump dynacom=20
(dynacom is my db'd name)
i kept getting=20

pg_dump: SQL command failed
pg_dump: Error message from server: ERROR: compressed data is corrupt
pg_dump: The command was: COPY public.mail_entity (msgno, entno, entparentn=
o....

so i tried dumping the individual mail_entity table, which resulted in the =
following errors:
pg_dump -t mail_entity > /dev/null
pg_dump: SQL command failed
pg_dump: Error message from server: ERROR: missing chunk number 2 for toas=
t value 133502683
pg_dump: The command was: COPY public.mail_entity (msgno, entno, entparentn=
o, entdate, entrecvdate, entsendername, entsenderaddr, entmess
ageid, en;
srv:~>

From the 76000 rows in that table i found the damaged columns by using the =
following technique=20
(which requires O(log(n)) selects btw lol!!!)
SELECT msgno,entno,entdate from mail_entity where coalesce(entdata::text,''=
)||coalesce(enttext,'') like '%foo%' and msgno/10000 =3D 0;
SELECT msgno,entno,entdate from mail_entity where coalesce(entdata::text,''=
)||coalesce(enttext,'') like '%foo%' and msgno/10000 =3D 1;
..... until i found the correct subset of 10000 rows
SELECT msgno,entno,entdate from mail_entity where coalesce(entdata::text,''=
)||coalesce(enttext,'') like '%foo%' and msgno/10000 =3D 7;
then
SELECT msgno,entno,entdate from mail_entity where coalesce(entdata::text,''=
)||coalesce(enttext,'') like '%foo%' and msgno/1000 =3D 70;
SELECT msgno,entno,entdate from mail_entity where coalesce(entdata::text,''=
)||coalesce(enttext,'') like '%foo%' and msgno/1000 =3D 71;
....
and so on untill i found the two (it was two of them) bad rows.
i did entdata=3D'' for those two rows, and the selects could be done withou=
t issues.

however, after that, the pg_dump -t reverted back to the aforementioned err=
or.
Now doing this gives:
srv:~> pg_dump -t mail_entity > /dev/null
pg_dump: SQL command failed
pg_dump: Error message from server: ERROR: compressed data is corrupt
pg_dump: The command was: COPY public.mail_entity (msgno, entno, entparentn=
o, entdate, entrecvdate, entsendername, entsenderaddr, entmessageid, en;
srv:~>

Then i did

# CREATE TABLE mail_entity2 AS SELECT * FROM mail_entity;

which went fine

but, for some crazy reason, pg_dump on mail_entity2 also results to an erro=
r:
srv:~> pg_dump -t mail_entity2 > /dev/null
pg_dump: SQL command failed
pg_dump: Error message from server: ERROR: compressed data is corrupt
pg_dump: The command was: COPY public.mail_entity2 (msgno, entno, entparent=
no, entdate, entrecvdate, entsendername, entsenderaddr, entmessageid, e;
srv:~> =20

Is there anything i could do to take this very much wanted dump?

--=20
Achilleas Mantzios

--=20
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

Re: pg_dump: Error message from server: ERROR: compressed data is corrupt

am 23.04.2010 16:05:46 von Tom Lane

Achilleas Mantzios writes:
> Then i did

> # CREATE TABLE mail_entity2 AS SELECT * FROM mail_entity;

> which went fine

> but, for some crazy reason, pg_dump on mail_entity2 also results to an error:
> srv:~> pg_dump -t mail_entity2 > /dev/null
> pg_dump: SQL command failed
> pg_dump: Error message from server: ERROR: compressed data is corrupt

The create/select would not have bothered to decompress any
inline-compressed datums, so the corrupted data went right over to the
new table. I think you'll have to engage in another round of
divide-and-conquer to locate the specific row or rows with a corrupted
value.

regards, tom lane

--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

Re: pg_dump: Error message from server: ERROR: compressed data is corrupt

am 27.04.2010 14:52:27 von Achilleus Mantzios

Στις Friday 23 April 2010 17:05:46 ο/η Tom La=
ne έγραψε:
> Achilleas Mantzios writes:
> > Then i did
>=20
> > # CREATE TABLE mail_entity2 AS SELECT * FROM mail_entity;
>=20
> > which went fine
>=20
> > but, for some crazy reason, pg_dump on mail_entity2 also results to an =
error:
> > srv:~> pg_dump -t mail_entity2 > /dev/null
> > pg_dump: SQL command failed
> > pg_dump: Error message from server: ERROR: compressed data is corrupt
>=20
> The create/select would not have bothered to decompress any
> inline-compressed datums, so the corrupted data went right over to the
> new table. I think you'll have to engage in another round of
> divide-and-conquer to locate the specific row or rows with a corrupted
> value.

We just removed one memory SIM, and the problem went away.
It must have been a problem caused by on the fly memory hardware error rath=
er than
actual corrupted data on the disk.
I have a decent dump now,
thank you a lot.

>=20
> regards, tom lane
>=20



--=20
Achilleas Mantzios

--=20
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin