This is a discussion on How to copy tables between databases? within the Pgsql General forums, part of the PostgreSQL category; --> Is there a simple way to copy a table from one database to another without generating an intermediate dump ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| 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...nsform%2C_load -- Tom Hart IT Specialist Cooperative Federal 723 Westcott St. Syracuse, NY 13210 (315) 471-1116 ext. 202 (315) 476-0567 (fax) ---------------------------(end of broadcast)--------------------------- TIP 6: explain analyze is your friend |
| |||
| On Tue, Feb 26, 2008 at 9:19 PM, Kynn Jones <kynnjo@gmail.com> 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 ---------------------------(end of broadcast)--------------------------- TIP 4: Have you searched our list archives? http://archives.postgresql.org/ |
| |||
| 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 ---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that your message can get through to the mailing list cleanly |
| |||
| 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 ---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that your message can get through to the mailing list cleanly |
| |||
| 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 <table name> <source DB> | psql -d <target DB> -- Brad Nicholson 416-673-4106 Database Administrator, Afilias Canada Corp. ---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq |
| ||||
| On Tue, Feb 26, 2008 at 2:36 PM, Brad Nicholson <bnichols@ca.afilias.info> 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 <table name> <source DB> | psql -d <target DB> Starting around 8.2 you can have > 1 -t switch, and grab a table or a wildcarded set of tables with each one. ---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster |