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

From peter@vfemail.net
Subject Re: Redirecting output from a SELECT command
Date
Msg-id 20101111200013.C45C91336971@mail.postgresql.org
Whole thread Raw
In response to Re: Redirecting output from a SELECT command  (Andreas Kretschmer <akretschmer@spamfence.net>)
List pgsql-novice
At 01:42 PM 11/11/2010, Andreas Kretschmer wrote:
>peter@vfemail.net <peter@vfemail.net> wrote:
>
>>
>> >From a shell prompt in FreeBSD, I can use a command like:
>>
>>     cat file.txt | mail email@domain.com
>>
>> 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@domain.com

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