Move Tables From One Database to Another - Mailing list pgsql-general

From Rich Shepard
Subject Move Tables From One Database to Another
Date
Msg-id alpine.LNX.2.00.1203291206550.7215@salmo.appl-ecosys.com
Whole thread Raw
Responses Re: Move Tables From One Database to Another
Re: Move Tables From One Database to Another
List pgsql-general
    I'm storing vector map attribute data in postgres tables and somehow
managed to create two databases (of similar names) rather than one. I want
to combine the two.

    For tables that exist in the one database I want to eliminate, I thought
to use pg_dump to create .sql files, then use pg_restore to add the table to
the other database. Did this for one table (with 4201 rows), but 'pg_restore
-d database_name -t table_name' appears to not complete; it seems to have
hung up somewhere. While I see nothing specific in the output file or the
pg_restore man page this must not be the proper approach.

   Also, I need suggestions on how to combine tables that exist in both
databases by adding rows from the source database not in the target database
and modifying rows that differ.

    As I'm not a professional or full-time DBA I'm probably missing really
simple syntax and approaches. Your advice will be appreciated.

Rich


pgsql-general by date:

Previous
From: Tom Molesworth
Date:
Subject: Re: Managing two sets of data in one database
Next
From: Gabriele Bartolini
Date:
Subject: Re: Move Tables From One Database to Another