Re: COPY TO '|gzip > /my/cool/file.gz'

Поиск
Список
Период
Сортировка
От Willy-Bas Loos
Тема Re: COPY TO '|gzip > /my/cool/file.gz'
Дата
Msg-id CAHnozTgDmYethXH57uKgmMR2juK8mHxTO3cg0uryvDQC_T7MEw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: COPY TO '|gzip > /my/cool/file.gz'  (Vibhor Kumar <vibhor.kumar@enterprisedb.com>)
Список pgsql-general
On Wed, Jul 20, 2011 at 8:53 PM, Vibhor Kumar
<vibhor.kumar@enterprisedb.com> wrote:
> You can use STDOUT to pipe output to a shell command and STDIN to read input from shell command.
> Something like given below:
> psql -c "COPY mytable to STDOUT"|gzip >/home/tgl/mytable.dump.gz
>
> cat filename|psql -c "COPY mytable from STDIN;"
>
> OR psql -c "COPY mytable from STDIN;" < filename

nice one, that works great!
(zcat instead of cat, though)

--
"Patriotism is the conviction that your country is superior to all
others because you were born in it." -- George Bernard Shaw

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

Предыдущее
От: Achilleas Mantzios
Дата:
Сообщение: Re: Choosing primary key type: 64 or 52 bit primary keys?
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: Tracing in Postgres