Re: [GENERAL] "FATAL 1: my bits moved right off the end of theworld!" - Mailing list pgsql-general

From Moray McConnachie
Subject Re: [GENERAL] "FATAL 1: my bits moved right off the end of theworld!"
Date
Msg-id 000c01bf3cd8$2159a9b0$760e01a3@oucs.ox.ac.uk
Whole thread Raw
In response to Re: [GENERAL] "FATAL 1: my bits moved right off the end of theworld!"  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-general
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.McConnachie@computing-services.oxford.ac.uk


Attachment

pgsql-general by date:

Previous
From: ^chewie
Date:
Subject: Re: [GENERAL] postgres libpq library
Next
From:
Date:
Subject: Re: [GENERAL] Except operation