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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

trigger calling external shell script

Status
Not open for further replies.

Hghlander

IS-IT--Management
Mar 9, 2004
18
US
So I am trying to create a postgresql function (postgres 8.1) to do the following:

CREATE FUNCTION mailme(text) RETURNS integer AS'
#!/bin/sh
/root/mailme.sh $1
' LANGUAGE plsh;

(I don't really care about the return of this, just want it to execute the shell script.)

CREATE TRIGGER updatemailme
AFTER INSERT OR UPDATE OR DELETE
ON records FOR EACH ROW
EXECUTE PROCEDURE mailme(name);

(name is a field in the records table of my database that I want as $1)

Anyone know if this would work or how I would go about doing this?

Thanks,
Dennis
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top