Re: [GENERAL] Somewhat automated method of cleaning table of corrupt records for pg_dump

2012-10-25 Thread Heiko Wundram
Am 22.10.2012 22:34, schrieb Martijn van Oosterhout: Something that has worked for me in the past is: $ SELECT ctid FROM table WHERE length(field) < 0; As the structure of the tables (about four were affected) isn't something that I wanted to actually look at, I set off writing a small scrip

Re: [GENERAL] Somewhat automated method of cleaning table of corrupt records for pg_dump

2012-10-22 Thread Martijn van Oosterhout
On Mon, Oct 22, 2012 at 11:54:47AM +0200, Heiko Wundram wrote: > If there's any other possibility of "out of the box" recovery - > except writing myself a small script to walk all rows - I'd still be > grateful for a hint. Something that has worked for me in the past is: $ SELECT ctid FROM table

Re: [GENERAL] Somewhat automated method of cleaning table of corrupt records for pg_dump

2012-10-22 Thread Heiko Wundram
Am 22.10.2012 09:05, schrieb Craig Ringer: Working strictly with a *copy*, does REINDEXing then CLUSTERing the tables help? VACCUM FULL on 8.3 won't rebuild indexes, so if index damage is the culprit a reindex may help. Then, if CLUSTER is able to rewrite the tables in index order you might be ab

Re: [GENERAL] Somewhat automated method of cleaning table of corrupt records for pg_dump

2012-10-22 Thread Craig Ringer
On 10/19/2012 10:31 PM, Heiko Wundram wrote: > Hey! > > I'm currently in the situation that due to (probably) broken memory in a > server, I have a corrupted PostgreSQL database. Getting at the data > that's in the DB is not time-critical (because backups have restored the > largest part of it), b

[GENERAL] Somewhat automated method of cleaning table of corrupt records for pg_dump

2012-10-19 Thread Heiko Wundram
Hey! I'm currently in the situation that due to (probably) broken memory in a server, I have a corrupted PostgreSQL database. Getting at the data that's in the DB is not time-critical (because backups have restored the largest part of it), but I'd still like to restore what can be restored fr