Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 771706359A9 for ; Thu, 13 Aug 2009 18:23:55 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 47100-01-7 for ; Thu, 13 Aug 2009 21:23:51 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from titania.wxnz.net (titania.wxnz.net [58.28.4.13]) by mail.postgresql.org (Postfix) with ESMTP id C6111634BBF for ; Thu, 13 Aug 2009 18:23:12 -0300 (ADT) Received: from gonzo (ip-118-90-139-27.xdsl.xnet.co.nz [118.90.139.27]) by titania.wxnz.net (Postfix) with ESMTP id 833851098173 for ; Fri, 14 Aug 2009 09:23:10 +1200 (NZST) Received: from news by gonzo with local (Exim 4.69) (envelope-from ) id 1MbZ6X-0004bP-IS for pgsql-sql@postgresql.org; Fri, 14 Aug 2009 00:08:25 +1200 To: pgsql-sql@postgresql.org Path: not-for-mail From: Jasen Betts Newsgroups: gmane.comp.db.postgresql.sql Subject: Re: mail alert Date: 13 Aug 2009 12:08:25 GMT Organization: Dis (not Dat) Organisation Lines: 26 Message-ID: References: NNTP-Posting-Host: localhost Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: reversiblemaps.ath.cx 1250165305 17693 127.0.0.1 (13 Aug 2009 12:08:25 GMT) X-Face: ?)Aw4rXwN5u0~$nqKj`xPz>xHCwgi^q+^?Ri*+R(&uv2=E1Q0Zk(>h!~o2ID@6{uf8s; a +M[5[U[QT7xFN%^gR"=tuJw%TXXR'Fp~W; (T"1(739R%m0Yyyv*gkGoPA.$b,D.w:z+<'"=-lVT?6 {T?=R^:W5g|E2#EhjKCa+nt":4b}dU7GYB*HBxn&Td$@f%.kl^:7X8rQWd[NTc"P"u6nkisze/Q; 8 "9Z{peQF,w)7UjV$c|RO/mQW/NMgWfr5*$-Z%u46"/00mx-,\R'fLPe.)^ User-Agent: slrn/pre1.0.0-2 (Linux) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.116 tagged_above=-10 required=5 tests=BAYES_40=-0.185, DATE_IN_PAST_06_12=1.069, RCVD_IN_DNSWL_LOW=-1 X-Spam-Level: X-Archive-Number: 200908/68 X-Sequence-Number: 32977 On 2009-08-11, Jan Verheyden wrote: > > Hi All, > > I was looking in what way it's possible to alert via mail when some conditi= > ons are true in a database. > > Thanks in advance! Assuming you mean email, and not ink on paper (hmm, OTOH you could load postcards into a printer....) you could do this using NOTIFY and a listener written in some other langauge, notify is really neat. or possibly invoke mail(1) with a plpythonu or C function, or as superuser you can write a file (using copy ...) and arrange for something else to look, find it, and mail it. arbitrary file contents are possible with copy: COPY (SELECT NULL) TO myfile_name WITH NULL AS myfile_contents;