Re: include shell commands in query - Mailing list pgsql-general

From Bruce Momjian
Subject Re: include shell commands in query
Date
Msg-id 200306161733.h5GHXeh07950@candle.pha.pa.us
Whole thread Raw
In response to include shell commands in query  ("Sebastian Kniat" <sebkniat@wp.pl>)
List 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@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

pgsql-general by date:

Previous
From: "Andrew J. Kopciuch"
Date:
Subject: Re: tsearch - v2
Next
From: Dennis Gearon
Date:
Subject: Re: include shell commands in query