Re: Pg_dump Query

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: Rebecca Clarke <rebecca(at)clarke(dot)net(dot)nz>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Pg_dump Query
Date: 2011-08-15 13:47:10
Message-ID: CAOR=d=3hH8poDHtXqKCYsiUi+HPR1RsvFMTHjQ6u2D+HqdD40w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Aug 15, 2011 at 6:10 AM, Rebecca Clarke <rebecca(at)clarke(dot)net(dot)nz> wrote:
> Hi
> I want to pg_dump only a select amount of rows from a table and restore them
> to a table on another server.
> Is there away to do this? I thought of using a view but how would I upload
> that into a specific table.  Copy? or is there something I can do with
> pg_restore.

You want to combine copy and select like so:

copy (select * from table where ...) to stdout;

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Merlin Moncure 2011-08-15 14:36:23 Re: Using Postgresql as application server
Previous Message Rebecca Clarke 2011-08-15 12:10:16 Pg_dump Query