Re: creating a dumpfile from a view

From: "Taras Kopets" <tkopets(at)gmail(dot)com>
To: "Richard Yen" <dba(at)richyen(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: creating a dumpfile from a view
Date: 2006-10-31 00:38:27
Message-ID: ce3f16fd0610301638g3b2458fbwf8aff22627fce927@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi!

Richard Yen wrote:

> Would anyone know how to dump the data from the view?

You should check COPY command in the manual:
http://www.postgresql.org/docs/current/static/sql-copy.html to save all your
data.
But you have to use tables with copy, not views.
Probably the solution will be to store all needed data in temporary table
and then use COPY to output data to file.

Try something like this:

> CREATE VIEW demtest AS
> SELECT foo.serial_no, foo.course_id, foo.writer_id,
> foo.assignment_type, bar.critique_serial_no, ...;

CREATE TEMPORARY TABLE temp_demtest AS SELECT * FROM demtest;
COPY temp_demtest TO 'output_file_path';

Taras Kopets

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Reece Hart 2006-10-31 00:43:23 Re: creating a dumpfile from a view
Previous Message richyen3@gmail.com 2006-10-31 00:34:17 creating a dumpfile from a view