469,090 Members | 1,187 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,090 developers. It's quick & easy.

Excute comnands OS from plpgsql

Hi!! Is there a way to execute script in OS from plpgsql???

__________________________________________________ _______________
Charla con tus amigos en línea mediante MSN Messenger:
http://messenger.yupimsn.com/
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 12 '05 #1
12 2062
Yes, you can use plsh

http://developer.postgresql.org/~petere/plsh.html

regards
Pavel

On Tue, 14 Oct 2003, Edwin Quijada wrote:
Hi!! Is there a way to execute script in OS from plpgsql???

__________________________________________________ _______________
Charla con tus amigos en línea mediante MSN Messenger:
http://messenger.yupimsn.com/
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 12 '05 #2
Edwin Quijada writes:
Hi!! Is there a way to execute script in OS from plpgsql???


No, you need to call a function written in an untrusted language, such as
PL/perlu.

--
Peter Eisentraut pe*****@gmx.net
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 12 '05 #3
CoL
hi,

Pavel Stehule wrote, On 10/14/2003 5:47 PM:
Yes, you can use plsh

http://developer.postgresql.org/~petere/plsh.html

regards
Pavel


or plperl, or plphp too :)

C.

Nov 12 '05 #4
On Tuesday 14 October 2003 16:38, Edwin Quijada wrote:
Hi!! Is there a way to execute script in OS from plpgsql???


I think there's a pl/sh procedural language (in contrib or gborg iirc), but
you could probably use any of the untrusted procedural languages.

Better, would be to use the LISTEN/NOTIFY feature to talk to an external
daemon that handles things for you, otherwise your script will run as the
same user as the backend.

--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 12 '05 #5
On Tue, 14 Oct 2003, CoL wrote:
hi,

Pavel Stehule wrote, On 10/14/2003 5:47 PM:
Yes, you can use plsh

http://developer.postgresql.org/~petere/plsh.html

regards
Pavel


or plperl, or plphp too :)


I think the new version must run in safe mode, as it installs as a trusted
language, or at least that's the impression I got.

Senior Drake?
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 12 '05 #6
On Tuesday 14 October 2003 17:15, Richard Huxton wrote:
On Tuesday 14 October 2003 16:38, Edwin Quijada wrote: How can I use NOtify to do this?


Please make sure you reply to the list too.

In your daemon you do something like: "LISTEN signal1", and in a trigger (say)
you issue "NOTIFY signal1". Your daemon will receive an asynchronoums message
"signal1" and you can then check the relevant tables for
updates/deletions/whatever signal1 means.

In practice, I usually don't care about responding that quickly, and just have
a cron job start up a script every 5 mins to check a "pending_jobs" table.

--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 12 '05 #7
Richard Huxton wrote:
On Tuesday 14 October 2003 16:38, Edwin Quijada wrote:
Hi!! Is there a way to execute script in OS from plpgsql???


I think there's a pl/sh procedural language (in contrib or gborg iirc), but
you could probably use any of the untrusted procedural languages.


There is certainly PL/TclU in the core distro.
Jan

--
#================================================= =====================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================= = Ja******@Yahoo.com #
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 12 '05 #8
CoL
hi,

Pavel Stehule wrote, On 10/14/2003 5:47 PM:
Yes, you can use plsh

http://developer.postgresql.org/~petere/plsh.html

regards
Pavel


or plperl, or plphp too :)

C.

Nov 12 '05 #9
On Tue, 14 Oct 2003, CoL wrote:
hi,

Pavel Stehule wrote, On 10/14/2003 5:47 PM:
Yes, you can use plsh

http://developer.postgresql.org/~petere/plsh.html

regards
Pavel


or plperl, or plphp too :)


I think the new version must run in safe mode, as it installs as a trusted
language, or at least that's the impression I got.

Senior Drake?
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 12 '05 #10
Richard Huxton wrote:
On Tuesday 14 October 2003 16:38, Edwin Quijada wrote:
Hi!! Is there a way to execute script in OS from plpgsql???


I think there's a pl/sh procedural language (in contrib or gborg iirc), but
you could probably use any of the untrusted procedural languages.


There is certainly PL/TclU in the core distro.
Jan

--
#================================================= =====================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================= = Ja******@Yahoo.com #
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 12 '05 #11
CoL
Hi,

scott.marlowe wrote, On 10/14/2003 9:54 PM:
On Tue, 14 Oct 2003, CoL wrote:
hi,

Pavel Stehule wrote, On 10/14/2003 5:47 PM:
> Yes, you can use plsh
>
> http://developer.postgresql.org/~petere/plsh.html
>
> regards
> Pavel


or plperl, or plphp too :)


I think the new version must run in safe mode, as it installs as a trusted
language, or at least that's the impression I got.

Senior Drake?


You are right.

C.
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 12 '05 #12
CoL
Hi,

scott.marlowe wrote, On 10/14/2003 9:54 PM:
On Tue, 14 Oct 2003, CoL wrote:
hi,

Pavel Stehule wrote, On 10/14/2003 5:47 PM:
> Yes, you can use plsh
>
> http://developer.postgresql.org/~petere/plsh.html
>
> regards
> Pavel


or plperl, or plphp too :)


I think the new version must run in safe mode, as it installs as a trusted
language, or at least that's the impression I got.

Senior Drake?


You are right.

C.
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 12 '05 #13

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Edwin Quijada | last post: by
6 posts views Thread by Martin Marques | last post: by
1 post views Thread by Rajesh Kumar Mallah | last post: by
reply views Thread by Steve Wampler | last post: by
10 posts views Thread by lnd | last post: by
4 posts views Thread by Bill Moran | last post: by
reply views Thread by sripathy sena | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by kglaser89 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.