Search Postgresql Archives

Re: How do I pipe output from query to a file in PostgreSQL?

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

 



On 26/10/2009 18:03, Penrod, John wrote:
> In oracle:
> 
> SPOOL filename.txt
> Select * from customer;
> SPOOL OFF
> 
> Results are piped to filename.txt
> 
> 
> How do I do this from the psql command line?

\g <filename> will execute the query and send the result to <filename>.


Ray.


-- 
Raymond O'Donnell :: Galway :: Ireland
rod@xxxxxx

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[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