Export SELECT statement as SQL queries in file - Mailing list pgsql-novice

From Mario Peshev
Subject Export SELECT statement as SQL queries in file
Date
Msg-id cd539d7e0705040645h7b532933gd8a6f58ec9d10c6e@mail.gmail.com
Whole thread Raw
Responses Re: Export SELECT statement as SQL queries in file  (Sean Davis <sdavis2@mail.nih.gov>)
List 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

pgsql-novice by date:

Previous
From: Phillip Smith
Date:
Subject: Re: Importing a CSV file to a table on Postgres
Next
From: Sean Davis
Date:
Subject: Re: Export SELECT statement as SQL queries in file