Connecting Tech Pros Worldwide Help | Site Map
 
 
LinkBack Thread Tools Search this Thread
  #1  
Old November 22nd, 2005, 08:51 AM
azaz
Guest
 
Posts: n/a
Default Copying tables between databases

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





  #2  
Old November 22nd, 2005, 08:51 AM
Christopher Browne
Guest
 
Posts: n/a
Default Re: Copying tables between databases

A long time ago, in a galaxy far, far away, "azaz" <oijazijai@azijza.com> wrote:[color=blue]
> 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[/color]

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
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 205,414 network members.