Re: Redirecting output from a SELECT command

From: peter(at)vfemail(dot)net
To: Andreas Kretschmer <akretschmer(at)spamfence(dot)net>, pgsql-novice(at)postgresql(dot)org
Subject: Re: Redirecting output from a SELECT command
Date: 2010-11-11 18:58:53
Message-ID: 20101111200013.C45C91336971@mail.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice


At 01:42 PM 11/11/2010, Andreas Kretschmer wrote:
>peter(at)vfemail(dot)net <peter(at)vfemail(dot)net> wrote:
>
>>
>> >From a shell prompt in FreeBSD, I can use a command like:
>>
>> cat file.txt | mail email(at)domain(dot)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(at)domain(dot)com

Super. Thank you!

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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Bastiaan Olij 2010-11-11 20:48:22 Interesting install issues on Windows 2003 domain server
Previous Message Andreas Kretschmer 2010-11-11 18:42:12 Re: Redirecting output from a SELECT command