Re: Backing up through a database connection (not pg_dump)
В списке pgsql-general по дате отправления:
| От | Eduardo Morras |
|---|---|
| Тема | Re: Backing up through a database connection (not pg_dump) |
| Дата | |
| Msg-id | 4EFDA8060142B294@ обсуждение исходный текст |
| Ответ на | Backing up through a database connection (not pg_dump) (Tim Uckun <timuckun@gmail.com>) |
| Список | pgsql-general |
At 01:05 27/03/2012, Tim Uckun wrote: >Is there a way to backup a database or a cluster though a database >connection? I mean I want to write some code that connects to the >database remotely and then issues a backup command like it would issue >any other SQL command. I realize the backups would need to reside on >the database server. You can use a stored procedure with this pl http://plsh.projects.postgresql.org/ , like this: CREATE FUNCTION dump_db(text, text) RETURNS text AS ' #!/bin/sh pg_dump $1 > $2 ' LANGUAGE plsh; Note that you must CREATE LANGUAGE first, $1 is db_name, $2 is file name and check for write permissions of $2. Be careful and check your security because any shell script will run as postgres user. Don't know if it works with 9.x+ versions of postgres. HTH
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера