Обсуждение: pl/pgsql question

Поиск
Список
Период
Сортировка

pl/pgsql question

От
"Rhys Stewart"
Дата:
hi all,
are there any function in pl/pgsql to call a shell script? or like is
there a pl/bash?

Rhys

Peace & Love | Live Long & Prosper

Re: pl/pgsql question

От
Adrian Klaver
Дата:
Two options I have run across.
pl/sh
http://developer.postgresql.org/~petere/pgplsh/
ShellSQL
http://www.edlsystems.com/shellsql/
On Friday 12 May 2006 07:54 am, Rhys Stewart wrote:
> hi all,
> are there any function in pl/pgsql to call a shell script? or like is
> there a pl/bash?
>
> Rhys
>
> Peace & Love | Live Long & Prosper
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
>                http://www.postgresql.org/docs/faq

--
Adrian Klaver
aklaver@comcast.net

Re: pl/pgsql question

От
Terry Lee Tucker
Дата:
On Friday 12 May 2006 10:54 am, "Rhys Stewart" <rhys.stewart@gmail.com> thus
communicated:
--> hi all,
--> are there any function in pl/pgsql to call a shell script? or like is
--> there a pl/bash?
-->

You can use Perl in "untrusted" mode as a backend function and accomplish
something like that.

Re: pl/pgsql question

От
Michael Fuhr
Дата:
On Fri, May 12, 2006 at 09:54:23AM -0500, Rhys Stewart wrote:
> are there any function in pl/pgsql to call a shell script? or like is
> there a pl/bash?

PL/sh might be what you're after; you could also use PL/Perl, etc.

http://pgfoundry.org/projects/plsh/

What does the shell script do?  Having the database invoke external
actions isn't always a good idea; for example, if the transaction
rolls back then you can't undo those actions.  Some problems are
better solved with LISTEN/NOTIFY because notifications don't go out
unless and until the transaction commits.

--
Michael Fuhr

Re: pl/pgsql question

От
"Joshua D. Drake"
Дата:
Rhys Stewart wrote:
> hi all,
> are there any function in pl/pgsql to call a shell script? or like is
> there a pl/bash?

Actually scary enough, there is pl/bash. Google is your friend. You can
also use:

plpython, plperl, plphp, pljava etc...


Joshua D. Drake

>
> Rhys
>
> Peace & Love | Live Long & Prosper
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
>               http://www.postgresql.org/docs/faq
>


--

            === The PostgreSQL Company: Command Prompt, Inc. ===
      Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
      Providing the most comprehensive  PostgreSQL solutions since 1997
                     http://www.commandprompt.com/