export from views

Started by Tomas Lanczosalmost 20 years ago3 messagesgeneral
Jump to latest
#1Tomas Lanczos
lanczos@t-zones.sk

Hello everybody,

I am quite a newbie in the database business, so sorry for stupid questions.
Is there any convenient and simple method/tool to export data from views to
file, something like COPY TO (file) from a table?

I am using WinXP and Postgresql 8.1.

Many thanks in advance

Tomas

#2Michael Glaesemann
grzm@seespotcode.net
In reply to: Tomas Lanczos (#1)
Re: export from views

On Apr 13, 2006, at 23:58 , Tomas Lanczos wrote:

Is there any convenient and simple method/tool to export data from
views to
file, something like COPY TO (file) from a table?

In psql, take a look at \o (and \? while you're at it).

Hope this helps.

Michael Glaesemann
grzm myrealbox com

#3John DeSoi
desoi@pgedit.com
In reply to: Tomas Lanczos (#1)
Re: export from views

On Apr 13, 2006, at 10:58 AM, Tomas Lanczos wrote:

I am quite a newbie in the database business, so sorry for stupid
questions.
Is there any convenient and simple method/tool to export data from
views to
file, something like COPY TO (file) from a table?

One option is to create a temp table and then use COPY on the temp
table. Something like

CREATE TEMP TABLE temp_table AS SELECT * from some_view;

It would be really nice if copy worked on views directly.

John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL