From: | "Moray McConnachie" <moray(dot)mcconnachie(at)computing-services(dot)oxford(dot)ac(dot)uk> |
---|---|
To: | <pgsql-general(at)postgresql(dot)org> |
Cc: | <ELOEHR(at)austin(dot)rr(dot)com> |
Subject: | Re: [GENERAL] "FATAL 1: my bits moved right off the end of theworld!" |
Date: | 1999-12-02 15:15:55 |
Message-ID: | 000c01bf3cd8$2159a9b0$760e01a3@oucs.ox.ac.uk |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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(dot)McConnachie(at)computing-services(dot)oxford(dot)ac(dot)uk
Attachment | Content-Type | Size |
---|---|---|
Re [GENERAL] FATAL 1 my bits moved right off the end of theworld!.txt | text/plain | 755 bytes |
From | Date | Subject | |
---|---|---|---|
Next Message | kaiq | 1999-12-02 15:50:25 | Re: [GENERAL] Date & Time |
Previous Message | ^chewie | 1999-12-02 14:11:29 | Re: [GENERAL] postgres libpq library |