Skip site navigation (1) Skip section navigation (2)

Re: pg_dump in stand alone backend

From: Ulrich Wisser <ulrich(dot)wisser(at)relevanttraffic(dot)se>
To: Daniel Martini <dmartini(at)uni-hohenheim(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: pg_dump in stand alone backend
Date: 2004-08-23 10:58:11
Message-ID: 4129CDC3.9000300@relevanttraffic.se (view raw or flat)
Thread:
Lists: pgsql-general
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 SeeleDate: 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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group