Re: [GENERAL] Can I backup/restore a database in a sql script?

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: [GENERAL] Can I backup/restore a database in a sql script?
Дата
Msg-id 467B91D3.60300@archonet.com
обсуждение исходный текст
Ответ на Can I backup/restore a database in a sql script?  ("Joost Kraaijeveld" <J.Kraaijeveld@Askesis.nl>)
Ответы Re: [GENERAL] Can I backup/restore a database in a sql script?  (Erik Jones <erik@myemma.com>)
Список pgsql-admin
Joost Kraaijeveld wrote:
> Hi,
>
> I want to write a sql script in which I backup a database and restore
> a new (altered) version of that database. Is that possible? If so ,
> can anyone give me an example of how to do that?
>
> I can run it from any command prompt (psql -U postgres template1 <
> my_db.backup)    but I would like it to run from psql (which should
> give me 1 script for all platforms I must do this: Windows, FreeBSD
> and Debian)

You can restore using just psql (because pg_dump can produce an sql file
to be processed). I don't know of any way to backup a database that
doesn't use pg_dump.

--
   Richard Huxton
   Archonet Ltd

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

Предыдущее
От: "Vishal Arora"
Дата:
Сообщение: Re: back up maintenance schedule
Следующее
От: davood khoshfetrat
Дата:
Сообщение: big tables in postgres and sub records.