Re: include shell commands in query

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Sebastian Kniat <sebkniat(at)wp(dot)pl>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: include shell commands in query
Date: 2003-06-16 17:33:40
Message-ID: 200306161733.h5GHXeh07950@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Sebastian Kniat wrote:
> Hello,
> is posible to include shell commands, like ping, into query?
> e.x.
> select current_timestamp, "ping IP_adress" into table table_name

You can do it in psql:

test=> \set x '\'' `pwd` '\''
test=> select :x;
?column?
---------------------------
/usr/var/local/users/root
(1 row)

See the psql manual page for more information.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dennis Gearon 2003-06-16 17:50:07 Re: include shell commands in query
Previous Message Bruce Momjian 2003-06-16 17:26:49 Re: Finding Current Page Size