Export SELECT statement as SQL queries in file

From: "Mario Peshev" <nofearinc(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Export SELECT statement as SQL queries in file
Date: 2007-05-04 13:45:42
Message-ID: cd539d7e0705040645h7b532933gd8a6f58ec9d10c6e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hey there,

I'm interested in getting the content of a SQL query into a file (possibly
as an INSERT clause). Is it possible to be done with an SQL statement? Now I
think it could be realised as [\copy (statement) to 'file'] construction,
but it's psql command. Is there another way?

Thanks in advance,
Mario

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Christian Leclerc 2007-05-04 13:51:33 Trigger and Notify
Previous Message Phillip Smith 2007-05-04 12:43:29 Re: Importing a CSV file to a table on Postgres