Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-novice by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group