Re: selective export for subsequent import (COPY)

From: Brent Wood <b(dot)wood(at)niwa(dot)co(dot)nz>
To: chrisj <chrisj(dot)wood(at)sympatico(dot)ca>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: selective export for subsequent import (COPY)
Date: 2007-04-19 23:19:06
Message-ID: 4627F8EA.1030907@niwa.co.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

chrisj wrote:
> I would like to do a selective export of a number of tables from a large
> database to import into a smaller (test) DB.
>
> I know about: psql dbname -tc "select * from tableX where whatever" >
> tableX.dat
>
You might try
psql dbname -Atc "select * from tableX where whatever" > tableX.dat

to produce un-aligned output, if this is your problem.

Brent Wood

> but unless I put it through a sed script, this file cannot be easily used
> for import.
>
> It feels like I am re-inventing the wheel. Does anybody know a better way
> or have a good sed script.
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Brent Wood 2007-04-19 23:26:42 Re: Postgres data/form entry tool
Previous Message Alvaro Herrera 2007-04-19 22:07:57 Re: dollar-quoting trouble