views:

103

answers:

2

I have 2 exactly same databases on 2 different machines(with different data that is), and I want to transfer contents of one table to the table from the other database, how do I do that from PgAdmin? I'm new to PostgreSQL Database, I'd do that easily with mysql phpmyadmin just export sql and I'd get text file with bunch of insert into statements, is there equivalent with PgAdmin ?

+1  A: 

pg_dump from the command line

PW
@PW 'pg_dump' is not recognized as operable program or batch file.
Gandalf StormCrow
PGROOT/bin/pg_dump where PGROOT is your install directory of Pg (same path as psql, issue a `which psql` and you'll have it)
PW
+1 for `pg_dump` (Milen A. Radev 's pgadmins export function is also just using this)
ChristopheD
+1  A: 

Yes, backup using "PLAIN" format (SQL statements) and then (when connected to the other DB) open the file and run it.

Or you could select "COMPRESS" format in the "backup" dialogue, and then you could use the restore dialogue.

Also there's an equivalent of phpMyAdmin for Postgres, called "phppgadmin". Select the table in question and then use the "Export" tab.

Milen A. Radev
This of course assumes there are no data clashing and/or remapping of value issues to deal with.
StarShip3000