Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Transferring data between servers

Status
Not open for further replies.

shnra

Programmer
Jul 24, 2003
1
NZ
I'm trying to think of a way to shift data between two postgres servers. Ideally, this would involve selecting data on a remote server, and having the result inserted into a table on the local server.
Short of selecting to a temp table, copying from, downloading the copied file and doing a copy to on the local server, I can't see a workable way to do this.

Any ideas anyone?

Thanks in advance,
Derry
 
Hi shnra,

The follow is from PostgreSQL 7.3 --> Administrator's Guide --> 9. Backup and Restore --> 9.1.1. Restoring the dump

#####################################################
The ability of pg_dump and psql to write to or read from pipes makes it possible to dump a database directly from one server to another, for example

pg_dump -h host1 dbname | psql -h host2 dbname

####################################################

Just create an empty database2 on Server2 and pipe a dump from database1 on Server1 to database2 on Server2.


LelandJ

Leland F. Jackson, CPA
Software - Master (TM)
Nothing Runs Like the Fox
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top