pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedHow to execute a system file in procedure?
2+ messages / 2 participants
[nested] [flat]
* How to execute a system file in procedure?
@ 2001-08-20 14:08 Raymond Chui <raymond.chui@noaa.gov>
2001-08-21 16:23 ` Re: How to execute a system file in procedure? Albert REINER <areiner@tph.tuwien.ac.at>
0 siblings, 1 reply; 2+ messages in thread
From: Raymond Chui @ 2001-08-20 14:08 UTC (permalink / raw)
To: pgsql-general@postgresql.org.pgsql-sql
I would like execute a system command or my program or my shell
script in procedure. How do I do that?
For example,
CREATE FUNCTION myname() RETURN OPAQUE AS '
BEGIN
IF count(NEW.aColumn) >= 600
THEN RAISE EXCEPTION ''Hello, it is time to re-index the
table.'';
END IF;
RETURN NEW;
END; '
LANGUAGE 'plpgsql';
CREATE TRIGGER AFTER INSERT OR UPDATE ON mytable
FOR EACH ROW EXECUTE PROCEDURE myname();
But I prefer to execute a system command like mail
mail -s "Re-Index" system@host.domain < `echo "It is time to re-index
the table"`
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: How to execute a system file in procedure?
2001-08-20 14:08 How to execute a system file in procedure? Raymond Chui <raymond.chui@noaa.gov>
@ 2001-08-21 16:23 ` Albert REINER <areiner@tph.tuwien.ac.at>
0 siblings, 0 replies; 2+ messages in thread
From: Albert REINER @ 2001-08-21 16:23 UTC (permalink / raw)
To: pgsql-sql; +Cc: Raymond Chui <raymond.chui@noaa.gov>
On Mon, Aug 20, 2001 at 10:08:36AM -0400, Raymond Chui wrote:
> I would like execute a system command or my program or my shell
> script in procedure. How do I do that?
use <http://www.postgresql.org/%7Epetere/plsh.html;.
Albert.
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2001-08-21 16:23 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-08-20 14:08 How to execute a system file in procedure? Raymond Chui <raymond.chui@noaa.gov>
2001-08-21 16:23 ` Albert REINER <areiner@tph.tuwien.ac.at>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox