Re: unable to dump database, toast errors - Mailing list pgsql-general

From Lonni J Friedman
Subject Re: unable to dump database, toast errors
Date
Msg-id Pine.LNX.4.44.0304070716530.1680-100000@beefcake.hdqt.vasoftware.com
Whole thread Raw
In response to Re: unable to dump database, toast errors  (Manfred Koizar <mkoi-pg@aon.at>)
List pgsql-general
On Mon, 7 Apr 2003, Manfred Koizar wrote:
> On Mon, 07 Apr 2003 07:34:47 -0400, Jan Wieck <JanWieck@Yahoo.com>
> wrote:
> >Is there any of those other columns that could identify a single row
> >uniquely? If so, that could work as a key for this purpose.
> >
> >If you have that, let's call it <keycolumn>.
>
> Lonni,
>
> let me add that if there is no such *user* column, you can always use
> the system column ctid:
>
>     SELECT ctid FROM artifact_file LIMIT 1 OFFSET 694;
>
>  ctid
> --------
>  (42,7)
>
> Now check whether this is really your broken tuple:
>
>     SELECT length(bin_data) FROM artifact_file
>      WHERE ctid = '(42,7)';  -- should give an ERROR
>
> ... and that all other tuples are ok as suggested by Jan:
>
>     SELECT sum(length(bin_data)) FROM artifact_file
>      WHERE NOT ctid = '(42,7)';  -- should work
>
> Note that you have to use 'NOT ctid =', because operator '!=' is not
> defined for datatype tid.

thanks for your reply.

# select ctid from artifact_file LIMIT 1 OFFSET 694;
  ctid
---------
 (16,33)

# select LENGTH(bin_data) from artifact_file where ctid='(16,33)';
ERROR:  missing chunk number 1 for toast value 7685119

# select sum(length(bin_data)) from artifact_file where NOT
ctid='(16,33)';
    sum
-----------
 293963428


So, where do i go from here?  Is it now just a matter of nullifying
bin_data for that particular row, or is it more involved?  thanks.

-Lonni


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: possible time change issue - known problem?
Next
From: Jürgen Hauser
Date:
Subject: Re: Enum in PostgreSQL - How to