Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sorry !!! =)

Status
Not open for further replies.

totti24

Programmer
Aug 2, 2002
32
MY

sorry to bother u ppl again. another question. is it possible to execute a shell command in pl/pgsql function? please advice . and i really appreciate for those of u who replied to my thread. thanks a lot. good day.
 
Hi totti24,

I'm not going to say that it can't be done, because someone may have figured out a way to do it. Usually the code that would be a shell script is incorporated into a postgres function. Postgres can execute functions in the following languages:

PL/pgsql
PL\tcl
PL\perl
PL\python

The following link will explain about client interfaces available under postgres; although, it isn't nearly complete. For example, I use Visual FoxPro 7 as a front-end to postgres and it is excellent, but there is no mention of it under "I. Client Interfaces". "II. Server Programming" explain how you can program postgres on the server side including procedural languages, and "III. Procedural Languages" list langauages available to build functions under postgres. If you want to use perl, tlk, or python to write your scripts, you must compile support for your language of choice into postgres.


Leland F. Jackson, CPA
Software - Master (TM)
Nothing Runs Like the Fox
 
Yes, if you install Perl as a procedural language in "untrusted" mode ('plperlu', instead of 'plperl'). This means that you can use Perl as a procedural language, with full access to the system resources. Thus, perl can call an external shell script.

I understand there are times when this can be a neat advantage with PostgreSQL, but use with care. -------------------------------------------

PHP/Perl/SQL/Javascript --
 

ic. thanx a lot guys. i was just wondering whether it can be done or not ? cheers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top