Redirecting output from a SELECT command

From: peter(at)vfemail(dot)net
To: pgsql-novice(at)postgresql(dot)org
Subject: Redirecting output from a SELECT command
Date: 2010-11-11 17:56:47
Message-ID: 20101111180537.8E9CD1336971@mail.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice


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?

I'd like to share a printed copy of that output with someone, and there's no printer connected to the database server, and I only have access to the database server from the console.

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

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Mladen Gogala 2010-11-11 18:04:15 Re: CSVLOG fields
Previous Message Richard Broersma 2010-11-11 17:15:48 Re: CSVLOG fields