Real Software Forums
http://forums.realsoftware.com/

Backup PostgreSQL
http://forums.realsoftware.com/viewtopic.php?f=3&t=47909
Page 1 of 1

Author:  jetpr [ Fri May 17, 2013 5:22 pm ]
Post subject:  Backup PostgreSQL

if some one now how to do Backup to a PostgreSQL DataBase Backup from a RS Application.

:idea:

Author:  Thom McGrath [ Fri May 17, 2013 5:24 pm ]
Post subject:  Re: Backup PostgreSQL

Don't try from within the app. It'll take an exceedingly long time. Instead use the pg_dump or pg_dumpall command line tools on the server, they are DRAMATICALLY faster and can run without taking the database offline.

Author:  taylor-design [ Fri May 17, 2013 8:48 pm ]
Post subject:  Re: Backup PostgreSQL

Note that you can run pg_dump and pg_dumpall from an RB application using the Shell class. This is nice if you need to provide a simple backup command, or if you want to check the result and send out alerts in the event of a failure.

Author:  jetpr [ Fri May 17, 2013 10:05 pm ]
Post subject:  Re: Backup PostgreSQL

if any example to check the result and send out alerts in the event of a failure
:?:

Author:  taylor-design [ Sat May 18, 2013 2:11 pm ]
Post subject:  Re: Backup PostgreSQL

jetpr wrote:
if any example to check the result and send out alerts in the event of a failure
:?:


Pass whatever string you would type on the command line to Shell.Execute. Shell.DataAvailable will let you read the output. Shell.Completed will let you know when it's done, and you can check Shell.ErrorCode in the Completed event for any errors.

A ready to run example is difficult because I don't know the path to pg_dump on your system, nor the database or options you wish to use for the backup. Check out the documentation for pg_dump:
http://www.postgresql.org/docs/9.2/stat ... gdump.html

Figure out the command you want to send to pg_dump and test it on the command line first. Once you have that, the RB side is simple.
http://docs.realsoftware.com/index.php/Shell

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/