How to copy tables between databases?

Поиск
Список
Период
Сортировка
Искать

How to copy tables between databases?

От:
"Kynn Jones" <kynnjo@gmail.com>
Дата:


Is there a simple way to copy a table from one database to another without generating an intermediate dump file?

TIA!

Kynn

Re: How to copy tables between databases?

От:
Tom Hart <tomhart@coopfed.org>
Дата:
Kynn Jones wrote:
>
>
> Is there a simple way to copy a table from one database to another 
> without generating an intermediate dump file?
>
> TIA!
>
> Kynn
>
You're looking for ETL.

http://en.wikipedia.org/wiki/Extract%2C_transform%2C_load

-- 
Tom Hart
IT Specialist
Cooperative Federal
723 Westcott St.
Syracuse, NY 13210
(315) 471-1116 ext. 202
(315) 476-0567 (fax)

Re: How to copy tables between databases?

От:
"Dawid Kuroczko" <qnex42@gmail.com>
Дата:
On Tue, Feb 26, 2008 at 9:19 PM, Kynn Jones  wrote:
>
> Is there a simple way to copy a table from one database to another without
> generating an intermediate dump file?

Using UNIX pipes :-)

$ pg_dump ... | psql ...

:-)

   Regards,
       Dawid

Re: How to copy tables between databases?

От:
Richard Huxton <dev@archonet.com>
Дата:
Kynn Jones wrote:
> Is there a simple way to copy a table from one database to another without
> generating an intermediate dump file?

Something along the lines of:
pg_dump ... -d db1 --table=mytable | psql -d db2

-- 
   Richard Huxton
   Archonet Ltd

Re: How to copy tables between databases?

От:
"Uwe C. Schroeder" <uwe@oss4u.com>
Дата:

On Tuesday 26 February 2008, Kynn Jones wrote:
> Is there a simple way to copy a table from one database to another without
> generating an intermediate dump file?
> TIA!
>
> Kynn


pg_dump -t [table] [database] | psql -U [remoteuser] -h [remotehost] 
[remotedatabase]

comes to mind...

You can and maybe have to add more switches to the pg_dump command, but the 
above is what I'm doing (my local db is set to trust) to copy a table with 
data to a remote machine

	Uwe

--
Open Source Solutions 4U, LLC	1618 Kelly St
Phone:  +1 707 568 3056		Santa Rosa, CA 95401
Cell:   +1 650 302 2405		United States
Fax:    +1 707 568 6416

Re: How to copy tables between databases?

От:
Brad Nicholson <bnichols@ca.afilias.info>
Дата:
On Tue, 2008-02-26 at 15:19 -0500, Kynn Jones wrote:
>
> Is there a simple way to copy a table from one database to another
> without generating an intermediate dump file?
> 

pg_dump -t   | psql -d 
-- 
Brad Nicholson  416-673-4106
Database Administrator, Afilias Canada Corp.


Re: How to copy tables between databases?

От:
"Scott Marlowe" <scott.marlowe@gmail.com>
Дата:
On Tue, Feb 26, 2008 at 2:36 PM, Brad Nicholson
 wrote:
> On Tue, 2008-02-26 at 15:19 -0500, Kynn Jones wrote:
>  >
>  > Is there a simple way to copy a table from one database to another
>  > without generating an intermediate dump file?
>  >
>
>  pg_dump -t   | psql -d 

Starting around 8.2 you can have > 1 -t switch, and grab a table or a
wildcarded set of tables with each one.
FAQ