Search Postgresql Archives

Re: creating a dumpfile from a view

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux