Re: selective export for subsequent import (COPY)

Поиск
Список
Период
Сортировка
От Brent Wood
Тема Re: selective export for subsequent import (COPY)
Дата
Msg-id 4627F8EA.1030907@niwa.co.nz
обсуждение исходный текст
Ответ на selective export for subsequent import (COPY)  (chrisj <chrisj.wood@sympatico.ca>)
Список 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.
>
>


В списке pgsql-general по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: dollar-quoting trouble
Следующее
От: Brent Wood
Дата:
Сообщение: Re: Postgres data/form entry tool