Re: copy data from one db into another via copy & psql

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: Kevin Kempter <kevink(at)consistentstate(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: copy data from one db into another via copy & psql
Date: 2010-05-21 06:24:19
Message-ID: AANLkTikk6uHeJOB3AERiiBVdljr0GRCvtHX4-TTrPFxR@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, May 20, 2010 at 10:59 PM, Kevin Kempter
<kevink(at)consistentstate(dot)com> wrote:
> Can I copy from one db (via COPY) and pipe the results to a psql/COPY stmt so
> I can load the data into a table in the second db 'inline' without writing to
> & reading from a flat file?

That's pretty much what

pg_dump -t tablename -d dbname | psql dbname

does. Add a -a and it's data only:

pg_dump -a -t tablename -d dbname | psql dbname

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2010-05-21 08:08:29 Re: How feasible is this?
Previous Message A. Kretschmer 2010-05-21 05:27:17 Re: copy data from one db into another via copy & psql