Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Wed Jul 26, 2017 1:29 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Backup PostgreSQL
PostPosted: Fri May 17, 2013 5:22 pm 
Offline
User avatar

Joined: Wed Sep 20, 2006 5:12 pm
Posts: 680
Location: Puerto Rico
if some one now how to do Backup to a PostgreSQL DataBase Backup from a RS Application.

:idea:

_________________
Thanks for any contribution and God blesses all (I start Using RS in 10/12/2010)
Mac Mini with Lion v10.7.5 and Real Studio 2012r1 Pro And Windows 7 RS2012r1 Personal and Linux RS2012r1 Personal Register user
my Hobbies R/C Turbines Jets Models


Top
 Profile  
Reply with quote  
 Post subject: Re: Backup PostgreSQL
PostPosted: Fri May 17, 2013 5:24 pm 
Offline
Site Admin
User avatar

Joined: Tue May 06, 2008 1:07 pm
Posts: 1464
Location: NotEvenOnTheMap, CT
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.

_________________
Thom McGrath - @tekcor
Web Framework Architect, Real Software, Inc.


Top
 Profile  
Reply with quote  
 Post subject: Re: Backup PostgreSQL
PostPosted: Fri May 17, 2013 8:48 pm 
Offline

Joined: Wed Mar 22, 2006 11:15 am
Posts: 712
Location: Southern California
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.

_________________
Daniel L. Taylor
Custom Controls for Real Studio WE!
Visit: http://www.webcustomcontrols.com/


Top
 Profile  
Reply with quote  
 Post subject: Re: Backup PostgreSQL
PostPosted: Fri May 17, 2013 10:05 pm 
Offline
User avatar

Joined: Wed Sep 20, 2006 5:12 pm
Posts: 680
Location: Puerto Rico
if any example to check the result and send out alerts in the event of a failure
:?:

_________________
Thanks for any contribution and God blesses all (I start Using RS in 10/12/2010)
Mac Mini with Lion v10.7.5 and Real Studio 2012r1 Pro And Windows 7 RS2012r1 Personal and Linux RS2012r1 Personal Register user
my Hobbies R/C Turbines Jets Models


Top
 Profile  
Reply with quote  
 Post subject: Re: Backup PostgreSQL
PostPosted: Sat May 18, 2013 2:11 pm 
Offline

Joined: Wed Mar 22, 2006 11:15 am
Posts: 712
Location: Southern California
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

_________________
Daniel L. Taylor
Custom Controls for Real Studio WE!
Visit: http://www.webcustomcontrols.com/


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group