Received: from clio.trends.ca (root@clio.trends.ca [209.47.148.2]) by hub.org (8.10.1/8.10.1) with ESMTP id e5C8csT97949; Mon, 12 Jun 2000 04:38:54 -0400 (EDT) Received: from mail.xnet.com (quake.xnet.com [198.147.221.67]) by clio.trends.ca (8.9.3+Sun/8.9.3) with ESMTP id SAA12289; Sun, 11 Jun 2000 18:29:16 -0400 (EDT) Received: from selkovjr.xnet.com (selkovjr.xnet.com [205.243.141.67]) by mail.xnet.com (8.9.3+Sun/XNet-3.0R) with ESMTP id RAA10665; Sun, 11 Jun 2000 17:29:05 -0500 (CDT) Message-Id: <200006112229.RAA10665@mail.xnet.com> To: pgsql-announce@postgreSQL.org cc: pgsql-admin@postgreSQL.org From: selkovjr@mcs.anl.gov Reply-to: selkovjr@mcs.anl.gov Subject: Sending e-mail from a trigger Date: Sun, 11 Jun 2000 16:53:55 -0500 X-Archive-Number: 200006/74 I haven't paid much attention to the discussions of SPI, but I remember seeing questions about the server-side system tasks in the trigger context, among which sending mail was the most frequent. I am not aware whether such questions were sufficiently answered in the lists, so when I had to write my first ever trigger yesterday, I felt like I was on my own with the system tasks (although the triggers and plpgsql are explained very well in the docs). So, here's my take on e-mail: http://wit.mcs.anl.gov/~selkovjr/pg_extensions/contrib.tgz (see the README in mail/) I believe it should be trivial to do other tasks in a similar way, using sockets and rsh. At least, it is better to do it that way than fork the backend. --Gene