Re: How to copy tables between databases?

From: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
To: "Brad Nicholson" <bnichols(at)ca(dot)afilias(dot)info>
Cc: "Kynn Jones" <kynnjo(at)gmail(dot)com>, "pgsql-general General" <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to copy tables between databases?
Date: 2008-02-26 21:00:26
Message-ID: dcc563d10802261300jbe0fdc3yf35afa7e482c60ed@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Feb 26, 2008 at 2:36 PM, Brad Nicholson
<bnichols(at)ca(dot)afilias(dot)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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2008-02-26 21:00:28 Re: utf8 issue
Previous Message fkater@googlemail.com 2008-02-26 20:51:57 win32: how to backup (dump does not work)