Daniel Martini wrote:
> Hi,
>
> Citing Ulrich Wisser <ulrich(dot)wisser(at)relevanttraffic(dot)se>:
>
>>I would like to stop the postmaster every night and run
>>
>>vacuum
>>pg_dump
>>reindex
>>
>>in the stand alone backend.
>>
>>Vacuum and reindex seem to be quite easy, as I can setup a small script
>>with both commands. But what about pg_dump. That seems "somewhat" more
>>complex.
>
>
> What exactly is your problem about putting pg_dump in a (shell)script as
> well?
psql will not work without postmaster running. But if I let postmaster
run some other tools will connect to it and I can't get exclusive locks
on all tables for "vacuum full" and "reindex". With vacuum and reindex
I can do
#!/bin/bash
postgres -d /var/lib/pgsql/data -U xxx -O -P mydb < SQL
REINDEX DATABASE mydb
REINDEX TABLE t1 FORCE
REINDEX TABLE t2
...
REINDEX TABLE tn
VACUUM FULL VERBOSE ANALYZE
<<SQL
which will speed up my database on a daily basis at least by factor 5.
For security reasons I would also like to take a backup and I guess it
will be much faster in the stand alone backend.
Ulrich
In response to
pgsql-general by date
| Next: | From: Michael Seele | Date: 2004-08-23 11:21:36 |
| Subject: select columns and its data types |
| Previous: | From: SVGK, Raju (Raju) | Date: 2004-08-23 10:44:05 |
| Subject: Re: view triggers/procedures |