Re: running script on the server

From: John McKown <john(dot)archie(dot)mckown(at)gmail(dot)com>
To: hamann(dot)w(at)t-online(dot)de
Cc: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: running script on the server
Date: 2015-07-29 04:21:07
Message-ID: CAAJSdjiA_0fL1kjj=3xg5OFWG7wrpzKKQDjoOuQ2AgMtDKMNgg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Jul 28, 2015 at 10:28 PM, <hamann(dot)w(at)t-online(dot)de> wrote:

>
> Hi,
>
> can any of the programming languages (perl, tcl) be used to exec a process
> on the server
> and open files?
> The scenario I have in mind would
> - copy some fields of a table to an external text file
> - have a script generate binary data from the text file
> - load that data into a large object
> The client would just
> select rebuild()
>

​Do you want all of the processing to be done on the server side? You need
to look into creating an _untrusted_ language such as PL/Tclu, plperlu, or
PL/Python (which is always / only untrusted). Those languages allow full
access to the TCL, PERL, or Python language, including running other
processes (which would run under the postgres UNIX id, not the client's
id).​

http://www.postgresql.org/docs/9.4/static/plpython.html
http://www.postgresql.org/docs/9.4/static/plperl-trusted.html
http://www.postgresql.org/docs/9.4/static/pltcl-overview.html

​Just to remind you: THIS CAN BE DANGEROUS TO THE HEALTH OF YOUR SERVER!
Your gun. Your ammo. Your foot. Aim carefully.​

>
> Best regards
> Wolfgang Hamann
>
> --
>
>
> gpg key: 92FCFB25
>
>
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

--

Schrodinger's backup: The condition of any backup is unknown until a
restore is attempted.

Yoda of Borg, we are. Futile, resistance is, yes. Assimilated, you will be.

He's about as useful as a wax frying pan.

10 to the 12th power microphones = 1 Megaphone

Maranatha! <><
John McKown

In response to

Browse pgsql-general by date

  From Date Subject
Next Message hamann.w 2015-07-29 05:17:44 Re: [SOLVED] running script on the server
Previous Message Adrian Klaver 2015-07-29 04:07:07 Re: running script on the server