Re: Need help on how to backup a table

From: "Adam Rich" <adam(dot)r(at)sbcglobal(dot)net>
To: "'ajcity'" <victor(dot)aluko(at)gmail(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Need help on how to backup a table
Date: 2008-03-28 13:31:02
Message-ID: 060901c890d7$f85b71d0$e9125570$@r@sbcglobal.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> Hi all,
> I am trying to backup a large table with about 6 million rows. I want
> to
> export the data from the table and be able to import it into another
> table
> on a different database server (from pgsql 8.1 to 8.2). I need to
> export the
> data through SQL query 'cause I want to do a gradual backup.
> Does pgsql have a facility for this?
> Thanks in advance for your reply.
>

Here's an easy solution:

psql -c "COPY command here" dbname | ssh user(at)host(dot)net "dd
of=/path/tbl.backup"

You can run this from your local server, and immediately pipe it over
a secure shell to the other server, and write it to a file there.
The /path/ you specify is local to the remote server.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2008-03-28 14:25:21 Re: Survey: renaming/removing script binaries (createdb, createuser...)
Previous Message Volkan YAZICI 2008-03-28 13:30:32 Re: SELECT DISTINCT ON and ORDER BY