Re: Redirecting output from a SELECT command - Mailing list pgsql-novice

From [email protected]
Subject Re: Redirecting output from a SELECT command
Date
Msg-id [email protected]
Whole thread Raw
In response to Re: Redirecting output from a SELECT command  (Andreas Kretschmer <[email protected]>)
List pgsql-novice
At 01:42 PM 11/11/2010, Andreas Kretschmer wrote:
>[email protected] <[email protected]> wrote:
>
>>
>> >From a shell prompt in FreeBSD, I can use a command like:
>>
>>     cat file.txt | mail [email protected]
>>
>> to e-mail the contents of a file somewhere.
>>
>> Is it possible from a PostgreSQL pgsql> shell prompt to e-mail the results of a:
>>
>>     select * from table;
>>
>> command somewhere?
>
>Sure.
>
>psql db_name -c "select * from table" | mail [email protected]

Super.  Thank you!


-------------------------------------------------
This message sent via VFEmail.net
http://www.vfemail.net
$14.95 Lifetime accounts - 1GB disk, No bandwidth quotas!


pgsql-novice by date:

Previous
From: Andreas Kretschmer
Date:
Subject: Re: Redirecting output from a SELECT command
Next
From: Bastiaan Olij
Date:
Subject: Interesting install issues on Windows 2003 domain server