Re: Run external command as part of an sql statement ?

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: David Gauthier <davegauthierpg(at)gmail(dot)com>
Cc: "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Run external command as part of an sql statement ?
Date: 2018-05-07 21:41:39
Message-ID: CAKFQuwYWhVm6bzCtXL5wuiFO1wj_9QA-JURNHyv2ZdEJTY2nBg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, May 7, 2018 at 2:35 PM, David Gauthier <davegauthierpg(at)gmail(dot)com>
wrote:

> Hi:
>
> At the psql prompt, I can do something like...
> "select \! id -nu"
> ...to get the uid of whoever's running psql.
>
> I want to be able to run a shell command like this from within a stored
> procedure. Is there a way to do this ?
>
>
​In core, you can probably use the untrusted​ version of Perl, Python, or
Tcl to accomplish your goal. SQL and pl/pgSQL do not provide that
capability.​

​David J.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2018-05-07 21:52:22 Re: Run external command as part of an sql statement ?
Previous Message David Gauthier 2018-05-07 21:35:49 Run external command as part of an sql statement ?