On 03/26/12 4:05 PM, 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.
there is no backup command in postgres SQL, you could enumerate the
tables, and use /COPY tablename TO filepath;/ on each table, these files
would have to be in a directory writable by the postgres server process.
alternately, you could open a shell session on the dbserver and run
pg_dump there. frankly, this would be preferable.
--
john r pierce N 37, W 122
santa cruz ca mid-left coast