copy table from one database to another - Mailing list pgsql-general

From John McKown
Subject copy table from one database to another
Date
Msg-id Pine.LNX.4.21.0009201635220.29700-100000@linux2.johnmckown.net
Whole thread Raw
Responses Re: copy table from one database to another  (Vince Vielhaber <vev@michvhf.com>)
List pgsql-general
Is there a simple way to copy a table from one database to another? I was
totally restructuring the tables in a database, so I simply created a new
database. There was one table in the old database whose information I
wanted. I really wanted to copy the table from the old database to the new
one and rename the table during the copy. What I ended up doing was using
"pg_dump -t table olddb >old.info", then I editted the "old.info" file to
point to the new database and renamed the table as well. I could then use
the "\i old.info" command in psql to import the information. Is there a
better without writing code in Perl or Python? (I.e. within psql).

Thanks,
John


pgsql-general by date:

Previous
From: "Edward Q. Bridges"
Date:
Subject: Re: Database Features Questions,
Next
From: Vince Vielhaber
Date:
Subject: Re: copy table from one database to another