Thomas Heinis <postgres@mailzone.ch> writes:
>> Just varchars, huh? Weird. What PG version are you running?
>> How many rows in the table?
>
> PG version is 7.0.2, OS is Red Hat Linux 6.2. The table has 614 rows.
The only thing I can think of is that the table has gotten corrupted so
that one or more of the varchar values appears huge --- ie, its length
word claims to be many megabytes instead of the correct value.
You should be able to home in on the corrupted row(s) by elimination:
figure out which rows you can select and which not. You can probably
even select the non-corrupted columns in the bad rows. Once you delete
the bad rows things should be OK again ... though a dump/initdb/reload
might be a good idea in case there are other problems. Did you suffer
a system crash recently?
regards, tom lane