From: | Ed Loehr <ELOEHR(at)austin(dot)rr(dot)com> |
---|---|
To: | Moray McConnachie <moray(dot)mcconnachie(at)computing-services(dot)oxford(dot)ac(dot)uk> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: [GENERAL] "FATAL 1: my bits moved right off the end of theworld!" |
Date: | 1999-12-02 18:27:27 |
Message-ID: | 3846BA0F.16F8F28@austin.rr.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Thanks. As your example demonstrates, automating a rebuild of indices via cron/perl/DBI is pretty straighforward. Unfortunately, reliability and
usability concerns in my application strongly suggest that the corrupted index really needs to be identified and rebuilt in real-time to allow the
original failed queries to be automatically retried to success, albeit a bit slower. Taking the system off-line to rebuild the corrupted index is *very*
undesirable. If I could get a true error indication in real-time from DBI/DBD::Pg that this was the problem, I think I could rebuild the index on the
fly. Not sure enough PG error information and/or codes are being returned to sufficiently identify the problem, though.
Cheers.
Ed
Moray McConnachie wrote:
> With all this talk of rebuilding indices, the following script does it
> for me:
>
> #!/bin/sh
> pg_dump -s databasename > filename
> perl -pi -e 'unless (/CREATE.*INDEX/) {s/.*//;chomp;}' filename
> perl -pi.create -e 's/CREATE.*?INDEX(.*?\s)ON.*/DROP INDEX$1\;/i;'
> filename
> mv filename filename.drop
> psql -d databasename -c '\i filename.drop'
> psql -d databasename -c '\i filename.create'
>
> Of course there are bound to be a million ways of scripting this
> without perl, but using awk or similar.
>
> You could cron this up - I don't know if regular rebuilding
> of indices helps minimise corruption?
>
> Yours,
> Moray
>
> ----------------------------------------------------------------------
> ----------------
> Moray(dot)McConnachie(at)computing-services(dot)oxford(dot)ac(dot)uk
>
> ----------------------------------------------------------------------
> Name: Re [GENERAL] FATAL 1 my bits moved right off the end of theworld!.txt
> Re [GENERAL] FATAL 1 my bits moved right off the end of theworld!.txt Type: Plain Text (text/plain)
> Encoding: quoted-printable
From | Date | Subject | |
---|---|---|---|
Next Message | Ed Loehr | 1999-12-02 19:16:32 | Re: [GENERAL] Date & Time |
Previous Message | Bruce Momjian | 1999-12-02 18:25:25 | Re: [GENERAL] book's pdf link/archive/documentation |