Re: pg_dump in stand alone backend

Поиск
Список
Период
Сортировка
От Ulrich Wisser
Тема Re: pg_dump in stand alone backend
Дата
Msg-id 4129CDC3.9000300@relevanttraffic.se
обсуждение исходный текст
Ответ на Re: pg_dump in stand alone backend  (Daniel Martini <dmartini@uni-hohenheim.de>)
Список pgsql-general
Daniel Martini wrote:

> Hi,
>
> Citing Ulrich Wisser <ulrich.wisser@relevanttraffic.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



В списке pgsql-general по дате отправления:

Предыдущее
От: Csaba Nagy
Дата:
Сообщение: Re: view triggers/procedures
Следующее
От: "SVGK, Raju (Raju)"
Дата:
Сообщение: Re: view triggers/procedures