By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,832 Members | 1,176 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,832 IT Pros & Developers. It's quick & easy.

Copying tables between databases

P: n/a
Hello all !
I'm a PostgreSQL newbie.
I'd like to know how to copy a table called TABLE1 and located in DATABASE1
as a TABLE2 which will be located in DATABASE2.
I have'nt found anything concerning table copies between databases with SQL.
Thanx for your help.
Jérôme
Nov 22 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a
A long time ago, in a galaxy far, far away, "azaz" <oi*******@azijza.com> wrote:
Hello all !
I'm a PostgreSQL newbie.
I'd like to know how to copy a table called TABLE1 and located in DATABASE1
as a TABLE2 which will be located in DATABASE2.
I have'nt found anything concerning table copies between databases with SQL.
Thanx for your help.
Jérôme


There is a "db_link" system that can do some crosslinks between
databases, but this isn't something you can accomplish directly in SQL...

Perhaps you might try:

% pg_dump -c -t TABLE1 DATABASE1 | psql DATABASE2

--
(format nil "~S@~S" "cbbrowne" "ntlug.org")
http://www.ntlug.org/~cbbrowne/rdbms.html
"I've run DOOM more in the last few days than I have the last few
months. I just love debugging ;-)" -- Linus Torvalds
Nov 22 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.