Re: executing OS programs from pg

From: "John Hansen" <john(at)geeknet(dot)com(dot)au>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Gevik babakhani" <gevik(at)xs4all(dot)nl>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: executing OS programs from pg
Date: 2005-06-04 02:36:58
Message-ID: 5066E5A966339E42AA04BA10BA706AE50A9332@rodrick.geeknet.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Look at peter eisentraut's procedural language PL/sh
It's on pgfoundry.

... John

> -----Original Message-----
> From: pgsql-hackers-owner(at)postgresql(dot)org
> [mailto:pgsql-hackers-owner(at)postgresql(dot)org] On Behalf Of Tom Lane
> Sent: Saturday, June 04, 2005 5:16 AM
> To: Gevik babakhani
> Cc: pgsql-hackers(at)postgresql(dot)org
> Subject: Re: [HACKERS] executing OS programs from pg
>
> "Gevik babakhani" <gevik(at)xs4all(dot)nl> writes:
> > Does anyone know how to execute an OS command from pgsql. I
> would like
> > to create a trigger that op on firing would run/execute an
> external program.
>
> Use any of the "untrusted" PLs to execute system() or the like.
>
> Whether this is a good idea or not is a different question
> --- there are excellent reasons why it is a *bad* idea to
> execute outside-the-database actions from within a trigger.
> Mainly that the actions won't be undone if the transaction
> later rolls back, and now your database state is inconsistent
> with outside-the-database state. See the list archives for
> many past discussions of this point and safer ways to design
> your application.
>
> (BTW, this is hardly material for -hackers.)
>
> regards, tom lane
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq
>
>

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2005-06-04 02:59:43 Re: psql: \d+ show tablespace of indices
Previous Message Qingqing Zhou 2005-06-04 02:10:16 Re: psql: \d+ show tablespace of indices