Re: Schema backup

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Schema backup
Дата
Msg-id 27255.1064609370@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Schema backup  ("Claudio Lapidus" <clapidus@hotmail.com>)
Список pgsql-general
"Claudio Lapidus" <clapidus@hotmail.com> writes:
> I need to transfer a database installation from one host to another. I need
> to dump all users, databases, schemas, stored procedures, triggers, etc. but
> no actual data at all. What I try to achieve is a fresh clone ready to run.
> I tried pg_dump -s and pg_dumpall, but somewhere I'm missing something, so:
> what is the procedure to dump all database structure alone, and what is the
> proper reload procedure?

The proper procedure IMHO would be
    pg_dumpall -s >dumpfile
    psql template1 <dumpfile

There is a small problem with this in 7.3.* (but not before or after):
due to an oversight, that version of pgdump_all doesn't support the -s
switch.  So if you are using 7.3 you have to do something like

    pg_dumpall -g >dumpfile
    for each database:
        pg_dump -C -s database >>dumpfile


            regards, tom lane

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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: Schema backup
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: Escape sequence for unicode characters