Re: offline consistency check and info on attributes

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tomas Vondra <tv(at)fuzzy(dot)cz>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: offline consistency check and info on attributes
Date: 2011-04-25 18:39:17
Message-ID: 1303755940-sup-9118@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Excerpts from Tomas Vondra's message of lun abr 25 14:50:18 -0300 2011:

> Yes, I know the tuple length is in HeapTupleHeader (and I'm already
> checking that), but that does not allow to check lengths of the
> individual columns, especially those with varlena types.
>
> That's a very annoying type of corruption, because the queries that do
> not touch such columns seem to work fine, but once you attempt to access
> the corrupted column you'll get something like this:
>
> pg_dump: SQL command failed
> pg_dump: Error message from server: ERROR: invalid memory alloc
> request size 4294967293

Yeah, I agree with this being less than ideal. However, as you
conclude, I don't think it's really workable to check this without
support from the running system. I wrote a dumb tool to attempt to
detoast all varlena columns, capture exceptions and report them; see the
code here:
http://alvherre.livejournal.com/4404.html
(You need to pass it a table name as a text parameter; that bit is
crap, as it fails for funny names). Note that this assumes that there
is a function length() for every varlena datatype in the table, which
may not be true for some of them.

--
Álvaro Herrera <alvherre(at)commandprompt(dot)com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2011-04-25 18:43:22 Re: branching for 9.2devel
Previous Message Robert Haas 2011-04-25 18:39:10 Re: Unlogged tables, persistent kind