Re: Exporting data from view
От
Brent Wood
Тема
Re: Exporting data from view
Дата
Msg-id
20060621085403.S36966@storm-user.niwa.co.nz
Ответ на
Re: Exporting data from view (Aaron Koning)
Список
Дерево обсуждения
Exporting data from view "Worky Workerson" <worky.workerson@gmail.com>
Re: Exporting data from view "Aaron Koning" <aaronkoning@gmail.com>
Re: Exporting data from view Brent Wood <b.wood@niwa.co.nz>
Re: Exporting data from view "Worky Workerson" <worky.workerson@gmail.com>
Re: Exporting data from view "Aaron Koning" <aaronkoning@gmail.com>
Re: Exporting data from view Martijn van Oosterhout <kleptog@svana.org>
Re: Exporting data from view "Aaron Koning" <aaronkoning@gmail.com>
Re: Exporting data from view Martijn van Oosterhout <kleptog@svana.org>
>
> I read recently about the efforts underway to COPY from a view,
> however I was wondering what the current best-practices are for being
> able to copy out of a view and import that data into an actual table
> elsewhere. I am currently doing psql -c "SELECT ..." and the using a
> bit of perl to transform that into something copyable (i.e. CSV), but
> is there a way to directly export the data in an easily importable
> form?
>
psql -A -t -c "select * from ";
You can use -F to set the delimiter
-o to specify an output file name (or just redirect stdout)
etc.
Try man psql
To redirect it into a table,
"insert into table ....
select .... ;"
between databases/systems
psql -d -p -A -t -c "select * from "; | psql ... "copy
from stdin...;"
can work, as the psql extract can be written to generate the same format
as copy from.
Brent Wood
В списке pgsql-general по дате отправления