From jan.verheyden@uz.kuleuven.ac.be Tue Aug 11 13:01:39 2009 Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 0B59763380B for ; Tue, 11 Aug 2009 10:01:39 -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 43240-10 for ; Tue, 11 Aug 2009 13:01:35 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mx2.uzleuven.be (mx2-int.uzleuven.be [134.58.179.12]) by mail.postgresql.org (Postfix) with ESMTP id A0DDD6336DB for ; Tue, 11 Aug 2009 10:01:35 -0300 (ADT) X-AuditID: 863ab30b-b7b68ae00000636c-47-4a816bac38cc Received: from leo.uz.kuleuven.ac.be (Unknown_Domain [193.190.32.47]) by mx2.uzleuven.be (UZLeuven Mail Server) with SMTP id 48.3F.25452.CAB618A4; Tue, 11 Aug 2009 15:01:32 +0200 (CEST) Received: from CONDOR.uz.kuleuven.ac.be (excclu21.uz.kuleuven.ac.be [172.22.3.45]) by leo.uz.kuleuven.ac.be (8.12.8/8.12.8) with ESMTP id n7BD1W54013939 for ; Tue, 11 Aug 2009 15:01:32 +0200 Received: from ex12-ch2-a.uz.kuleuven.ac.be ([172.22.3.114]) by CONDOR.uz.kuleuven.ac.be with Microsoft SMTPSVC(6.0.3790.1830); Tue, 11 Aug 2009 15:01:32 +0200 Received: from EX2007-MBX-2.uz.kuleuven.ac.be ([172.22.12.40]) by ex12-ch2-a.uz.kuleuven.ac.be ([172.22.3.114]) with mapi; Tue, 11 Aug 2009 15:01:32 +0200 From: Jan Verheyden To: "'pgsql-sql@postgresql.org'" Date: Tue, 11 Aug 2009 15:01:31 +0200 Subject: mail alert Thread-Topic: mail alert Thread-Index: AcoaVBaDp/oR4ASQR9Cut7qDJUv4NQAL6c5Q Message-ID: Accept-Language: nl-NL, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: nl-NL, en-US Content-Type: multipart/alternative; boundary="_000_E30C7040DE22624185BAD4093190B54437BE5DB49CEX2007MBX2uzk_" MIME-Version: 1.0 X-OriginalArrivalTime: 11 Aug 2009 13:01:32.0345 (UTC) FILETIME=[D95FC290:01CA1A83] X-Scanned-By: MIMEDefang 2.48 on 193.190.32.47 X-UZLTracking: ksdfkKHKYKPjnqsdKhlfd X-Brightmail-Tracker: AAAAAgAAAZEQPEw0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=3.702 tagged_above=-10 required=5 tests=BAYES_50=0.001, HTML_MESSAGE=0.001, PYZOR_CHECK=3.7 X-Spam-Level: *** X-Archive-Number: 200908/49 X-Sequence-Number: 32958 --_000_E30C7040DE22624185BAD4093190B54437BE5DB49CEX2007MBX2uzk_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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! Jan --_000_E30C7040DE22624185BAD4093190B54437BE5DB49CEX2007MBX2uzk_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi All,

 

I was looking in what way it’s possible to alert= via mail when some conditions are true in a database.

 

Thanks in advance!

 

Jan

--_000_E30C7040DE22624185BAD4093190B54437BE5DB49CEX2007MBX2uzk_-- From dbucherml@hsolutions.ch Tue Aug 11 22:36:03 2009 Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 956A8633D1B for ; Tue, 11 Aug 2009 19:36:03 -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 81304-09 for ; Tue, 11 Aug 2009 22:36:00 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from cirrus.hsolutions.ch (cirrus.hsolutions.ch [212.203.66.103]) by mail.postgresql.org (Postfix) with ESMTP id 5511D6339BF for ; Tue, 11 Aug 2009 19:36:00 -0300 (ADT) Received: from [127.0.0.1] (unknown [78.234.64.238]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by cirrus.hsolutions.ch (Postfix) with ESMTPSA id 1C115790001; Wed, 12 Aug 2009 00:39:01 +0200 (CEST) Message-ID: <4A81F244.9070402@hsolutions.ch> Date: Wed, 12 Aug 2009 00:35:48 +0200 From: Denis BUCHER Organization: Horus Digital Solutions =?UTF-8?B?U8Ogcmw=?= User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: Jan Verheyden CC: "'pgsql-sql@postgresql.org'" Subject: Re: mail alert References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200908/52 X-Sequence-Number: 32961 Hello, Jan Verheyden a écrit : > I was looking in what way it’s possible to alert via mail when some > conditions are true in a database. a) If the alert is not "very urgent" i.e. you can alter some minutes later I would do it like this : 1. Create a function that returns what you need, most importantly if the conditions are met 2. Create a script that does something like "SELECT * FROM function()..." b) If the email should be sent immediately, you could create a perl function in the database, launched by a TRIGGER and launching an "external" script... Therefore, first you have to know the requirements... Denis From robjsargent@gmail.com Wed Aug 12 01:36:40 2009 Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 62170634212 for ; Tue, 11 Aug 2009 22:36:40 -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 12124-09 for ; Wed, 12 Aug 2009 01:36:36 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from out01.mta.xmission.com (out01.mta.xmission.com [166.70.13.231]) by mail.postgresql.org (Postfix) with ESMTP id 0797C6327E5 for ; Tue, 11 Aug 2009 22:36:36 -0300 (ADT) Received: from in01.mta.xmission.com ([166.70.13.51]) by out01.mta.xmission.com with esmtp (Exim 4.62) (envelope-from ) id 1Mb2ll-0003QL-Jw; Tue, 11 Aug 2009 19:36:49 -0600 Received: from rsargent.dsl.xmission.com ([199.104.125.126] helo=[192.168.0.2]) by in01.mta.xmission.com with esmtp (Exim 4.69) (envelope-from ) id 1Mb2lU-0006ds-5Z; Tue, 11 Aug 2009 19:36:32 -0600 Message-ID: <4A821D12.3050500@gmail.com> Date: Tue, 11 Aug 2009 19:38:26 -0600 From: Rob Sargent User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: Denis BUCHER CC: Jan Verheyden , "'pgsql-sql@postgresql.org'" References: <4A81F244.9070402@hsolutions.ch> In-Reply-To: <4A81F244.9070402@hsolutions.ch> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-XM-SPF: eid=; ; ; mid=; ; ; hst=in01.mta.xmission.com; ; ; ip=199.104.125.126; ; ; frm=robjsargent@gmail.com; ; ; spf=neutral X-XM-DomainKey: sender_domain=gmail.com; ; ; sender=robjsargent@gmail.com; ; ; status=no signature X-SA-Exim-Connect-IP: 199.104.125.126 X-SA-Exim-Rcpt-To: dbucherml@hsolutions.ch, jan.verheyden@uz.kuleuven.ac.be, pgsql-sql@postgresql.org X-SA-Exim-Mail-From: robjsargent@gmail.com X-Spam-DCC: XMission; sa01 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ;Denis BUCHER X-Spam-Relay-Country: Subject: Re: mail alert X-SA-Exim-Version: 4.2.1 (built Thu, 25 Oct 2007 00:26:12 +0000) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.11 tagged_above=-10 required=5 tests=BAYES_05=-1.11, RCVD_IN_DNSWL_LOW=-1 X-Spam-Level: X-Archive-Number: 200908/53 X-Sequence-Number: 32962 Denis BUCHER wrote: > Hello, > > Jan Verheyden a écrit : > >> I was looking in what way it’s possible to alert via mail when some >> conditions are true in a database. >> > > a) If the alert is not "very urgent" i.e. you can alter some minutes > later I would do it like this : > > 1. Create a function that returns what you need, most importantly if the > conditions are met > > 2. Create a script that does something like "SELECT * FROM function()..." > > b) If the email should be sent immediately, you could create a perl > function in the database, launched by a TRIGGER and launching an > "external" script... > > Therefore, first you have to know the requirements... > > Denis > > see "check_postgres" for nagios-style monitoring see \o /tmp/alert_data_file and \! mailx -s "alert" me@work.com /tmp/alert_data_file From ramasubramanian.g@renaissance-it.com Wed Aug 12 04:00:59 2009 Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 5A97A634C2B for ; Wed, 12 Aug 2009 01:00:59 -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 42205-08 for ; Wed, 12 Aug 2009 04:00:56 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from renaissance-it.com (mail.renaissance-it.com [164.164.87.55]) by mail.postgresql.org (Postfix) with ESMTP id 5AC386327E5 for ; Wed, 12 Aug 2009 01:00:52 -0300 (ADT) Received: (qmail 2053 invoked by uid 109); 12 Aug 2009 04:01:21 -0000 Received: from 192.168.1.6 by Mailsrv (envelope-from , uid 112) with qmail-scanner-1.25st (spamassassin: 3.1.7-deb. perlscan: 1.25st. Clear:RC:1(192.168.1.6):. Processed in 0.064657 secs); 12 Aug 2009 04:01:21 -0000 Received: from unknown (HELO ramasubramanian) (ramasubramanian.g@[192.168.1.6]) (envelope-sender ) by renaissance-it.com (qmail-ldap-1.03) with SMTP for ; 12 Aug 2009 04:01:20 -0000 Message-ID: From: "ramasubramanian" To: "Jan Verheyden" , References: Subject: Re: mail alert Date: Wed, 12 Aug 2009 09:31:13 +0530 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_010A_01CA1B2F.A24B7EF0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.002 tagged_above=-10 required=5 tests=BAYES_50=0.001, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200908/55 X-Sequence-Number: 32964 This is a multi-part message in MIME format. ------=_NextPart_000_010A_01CA1B2F.A24B7EF0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, Can you just tell me whether your database is place on which = server(linux/or windows or..)? ----- Original Message -----=20 From: Jan Verheyden=20 To: 'pgsql-sql@postgresql.org'=20 Sent: Tuesday, August 11, 2009 6:31 PM Subject: [SQL] mail alert Hi All, =20 I was looking in what way it's possible to alert via mail when some = conditions are true in a database. =20 Thanks in advance! =20 Jan ------=_NextPart_000_010A_01CA1B2F.A24B7EF0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi,
    Can you just tell me = whether=20 your database is place on which server(linux/or windows = or..)?
----- Original Message -----
From:=20 Jan Verheyden =
Sent: Tuesday, August 11, 2009 = 6:31=20 PM
Subject: [SQL] mail alert

Hi All,

 

I was looking in what way it=92s possible to = alert via mail=20 when some conditions are true in a database.

 

Thanks in advance!

 

Jan

------=_NextPart_000_010A_01CA1B2F.A24B7EF0-- From shoaibmir@gmail.com Wed Aug 12 06:15:06 2009 Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 6EBB26337C2 for ; Wed, 12 Aug 2009 03:15:06 -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 64769-03 for ; Wed, 12 Aug 2009 06:15:03 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-yw0-f183.google.com (mail-yw0-f183.google.com [209.85.211.183]) by mail.postgresql.org (Postfix) with ESMTP id 48436632B7F for ; Wed, 12 Aug 2009 03:15:03 -0300 (ADT) Received: by ywh13 with SMTP id 13so5370498ywh.15 for ; Tue, 11 Aug 2009 23:15:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=zbPWHq0mClGmfZR6fyXsvcUItoRCsoQWorGjivmd2M4=; b=CAorCl2wCqBefZydDvxFGBLo9y3iyCg8zUPPaGXgNywlHt/5SvWKyKJ9wEQgVeWpyP tU781UYshx1J2Khl4LB0teXpd2npBtc3/hTeGXQI9oPrnxJiI/hLveSR34MfMzoz8cex GOjK6esSCBjQ+btotryan8VDzMEWMypWBmxxI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=s1Hbty7RIEBmhJqQT9CJKQ8YOIjDGNsx6tWssrpASMKjCROotsnwyJpwTi1lcXg80V nx9WtZCcvrBjHCwSkjQNXu4PdVGLt7VTo+0KBL5vWSlP534NApeWZryTIw22PPp6KQEX /8hD6k74iJonjZ2YVoWbOie8IuaveVGM7YO5Q= MIME-Version: 1.0 Received: by 10.91.161.39 with SMTP id n39mr388344ago.88.1250057702497; Tue, 11 Aug 2009 23:15:02 -0700 (PDT) In-Reply-To: References: Date: Wed, 12 Aug 2009 16:15:02 +1000 Message-ID: Subject: Re: mail alert From: Shoaib Mir To: ramasubramanian Cc: Jan Verheyden , pgsql-sql@postgresql.org Content-Type: multipart/alternative; boundary=0016362844c64e5f930470ebbded X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.598 tagged_above=-10 required=5 tests=BAYES_00=-2.599, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200908/56 X-Sequence-Number: 32965 --0016362844c64e5f930470ebbded Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable > ----- Original Message ----- > *From:* Jan Verheyden > *To:* 'pgsql-sql@postgresql.org' <%27pgsql-sql@postgresql.org%27> > *Sent:* Tuesday, August 11, 2009 6:31 PM > *Subject:* [SQL] mail alert > > Hi All, > > > > I was looking in what way it=92s possible to alert via mail when some > conditions are true in a database. > > > > I guess you might be able to do that by using PLPython, PLPerl or PLTcl and using the standard functions for doing emails in there. --=20 Shoaib Mir http://shoaibmir.wordpress.com/ --0016362844c64e5f930470ebbded Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable
----- Original Message -----
From:=20 Jan Verheyden
Sent: Tuesday, August 11, 2009 6:3= 1=20 PM
Subject: [SQL] mail alert

Hi All,

=A0

I was looking in what way it=92s possible to alert via mail=20 when some conditions are true in a database.

=A0


I guess you might be able = to do that by using PLPython, PLPerl or PLTcl and using the standard functi= ons for doing emails in there.

--
Shoaib Mir
http://shoaibmir.wordpress.com/=
--0016362844c64e5f930470ebbded-- From jan.verheyden@uz.kuleuven.ac.be Wed Aug 12 07:29:56 2009 Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 2965C6327E5 for ; Wed, 12 Aug 2009 04:29:56 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 25945-05 for ; Wed, 12 Aug 2009 07:29:41 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mx2.uzleuven.be (mx2-int.uzleuven.be [134.58.179.12]) by mail.postgresql.org (Postfix) with ESMTP id E2AFF63223F for ; Wed, 12 Aug 2009 04:29:44 -0300 (ADT) X-AuditID: 863ab30b-b7b68ae00000636c-02-4a826f67bc16 Received: from leo.uz.kuleuven.ac.be (Unknown_Domain [193.190.32.47]) by mx2.uzleuven.be (UZLeuven Mail Server) with SMTP id 21.71.25452.76F628A4; Wed, 12 Aug 2009 09:29:43 +0200 (CEST) Received: from CONDOR.uz.kuleuven.ac.be (excclu21.uz.kuleuven.ac.be [172.22.3.45]) by leo.uz.kuleuven.ac.be (8.12.8/8.12.8) with ESMTP id n7C7Tg54018771; Wed, 12 Aug 2009 09:29:42 +0200 Received: from ex12-ch2-a.uz.kuleuven.ac.be ([172.22.3.114]) by CONDOR.uz.kuleuven.ac.be with Microsoft SMTPSVC(6.0.3790.1830); Wed, 12 Aug 2009 09:29:42 +0200 Received: from EX2007-MBX-2.uz.kuleuven.ac.be ([172.22.12.40]) by ex12-ch2-a.uz.kuleuven.ac.be ([172.22.3.114]) with mapi; Wed, 12 Aug 2009 09:29:42 +0200 From: Jan Verheyden To: "'ramasubramanian'" , "'pgsql-sql@postgresql.org'" Date: Wed, 12 Aug 2009 09:29:41 +0200 Subject: Re: mail alert Thread-Topic: [SQL] mail alert Thread-Index: AcobAYXLaPzXEvscSQCUnbh3MGurmQAHRPhQ Message-ID: References: In-Reply-To: Accept-Language: nl-NL, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: nl-NL, en-US Content-Type: multipart/alternative; boundary="_000_E30C7040DE22624185BAD4093190B54437BE5DB4A9EX2007MBX2uzk_" MIME-Version: 1.0 X-OriginalArrivalTime: 12 Aug 2009 07:29:42.0499 (UTC) FILETIME=[A8981B30:01CA1B1E] X-Scanned-By: MIMEDefang 2.48 on 193.190.32.47 X-UZLTracking: ksdfkKHKYKPjnqsdKhlfd X-Brightmail-Tracker: AAAAAQAAAZE= X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.307 tagged_above=-10 required=5 tests=AWL=0.802, BAYES_05=-1.11, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200908/62 X-Sequence-Number: 32971 --_000_E30C7040DE22624185BAD4093190B54437BE5DB4A9EX2007MBX2uzk_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable It's on Windows From: ramasubramanian [mailto:ramasubramanian.g@renaissance-it.com] Sent: Wednesday, August 12, 2009 6:01 AM To: Jan Verheyden; pgsql-sql@postgresql.org Subject: Re: [SQL] mail alert Hi, Can you just tell me whether your database is place on which server(lin= ux/or windows or..)? ----- Original Message ----- From: Jan Verheyden To: 'pgsql-sql@postgresql.org' Sent: Tuesday, August 11, 2009 6:31 PM Subject: [SQL] mail alert 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! Jan --_000_E30C7040DE22624185BAD4093190B54437BE5DB4A9EX2007MBX2uzk_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

It’s on Windows

 =

From: ramasubramani= an [mailto:ramasubramanian.g@renaissance-it.com]
Sent: Wednesday, August 12, 2009 6:01 AM
To: Jan Verheyden; pgsql-sql@postgresql.org
Subject: Re: [SQL] mail alert

 

Hi,

    Can you just tell me whether your database is place on which server(linux/o= r windows or..)?

----- Original Message -----

Sent: Tuesday, Augus= t 11, 2009 6:31 PM

Subject: [SQL] mail ale= rt

 

Hi All,

 

I was looking in what way it’s possible to alert= via mail when some conditions are true in a database.

 

Thanks in advance!

 

Jan

--_000_E30C7040DE22624185BAD4093190B54437BE5DB4A9EX2007MBX2uzk_-- From jan.verheyden@uz.kuleuven.ac.be Wed Aug 12 13:27:54 2009 Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 202D76337C2 for ; Wed, 12 Aug 2009 10:27:54 -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 40730-05 for ; Wed, 12 Aug 2009 13:27:50 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mx2.uzleuven.be (mx2-int.uzleuven.be [134.58.179.12]) by mail.postgresql.org (Postfix) with ESMTP id 3973D633362 for ; Wed, 12 Aug 2009 10:27:49 -0300 (ADT) X-AuditID: 863ab30b-b7b68ae00000636c-08-4a82c351a0e4 Received: from leo.uz.kuleuven.ac.be (Unknown_Domain [193.190.32.47]) by mx2.uzleuven.be (UZLeuven Mail Server) with SMTP id 65.26.25452.153C28A4; Wed, 12 Aug 2009 15:27:45 +0200 (CEST) Received: from CONDOR.uz.kuleuven.ac.be (excclu21.uz.kuleuven.ac.be [172.22.3.45]) by leo.uz.kuleuven.ac.be (8.12.8/8.12.8) with ESMTP id n7CDQn5C011981; Wed, 12 Aug 2009 15:27:44 +0200 Received: from ex12-ch2-a.uz.kuleuven.ac.be ([172.22.3.114]) by CONDOR.uz.kuleuven.ac.be with Microsoft SMTPSVC(6.0.3790.1830); Wed, 12 Aug 2009 15:27:27 +0200 Received: from EX2007-MBX-2.uz.kuleuven.ac.be ([172.22.12.40]) by ex12-ch2-a.uz.kuleuven.ac.be ([172.22.3.114]) with mapi; Wed, 12 Aug 2009 15:27:26 +0200 From: Jan Verheyden To: "'Rob Sargent'" , "'Denis BUCHER'" CC: "'pgsql-sql@postgresql.org'" Date: Wed, 12 Aug 2009 15:27:25 +0200 Subject: Re: mail alert Thread-Topic: [SQL] mail alert Thread-Index: Acoa7VeAuKMEB5SMS82yShzCVd2p5wAYVSFA Message-ID: References: <4A81F244.9070402@hsolutions.ch> <4A821D12.3050500@gmail.com> In-Reply-To: <4A821D12.3050500@gmail.com> Accept-Language: nl-NL, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: nl-NL, en-US Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-OriginalArrivalTime: 12 Aug 2009 13:27:27.0156 (UTC) FILETIME=[A286D740:01CA1B50] X-Scanned-By: MIMEDefang 2.48 on 193.190.32.47 X-UZLTracking: ksdfkKHKYKPjnqsdKhlfd X-Brightmail-Tracker: AAAAAQAAAZE= X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, h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b3VsZCBjcmVhdGUgYSBwZXJsDQo+IGZ1bmN0 aW9uIGluIHRoZSBkYXRhYmFzZSwgbGF1bmNoZWQgYnkgYSBUUklHR0VSIGFuZCBsYXVuY2hpbmcg YW4NCj4gImV4dGVybmFsIiBzY3JpcHQuLi4NCj4NCj4gVGhlcmVmb3JlLCBmaXJzdCB5b3UgaGF2 ZSB0byBrbm93IHRoZSByZXF1aXJlbWVudHMuLi4NCj4NCj4gRGVuaXMNCj4NCj4gICANCnNlZSAi Y2hlY2tfcG9zdGdyZXMiIGZvciBuYWdpb3Mtc3R5bGUgbW9uaXRvcmluZw0Kc2VlIFxvIC90bXAv YWxlcnRfZGF0YV9maWxlDQphbmQgXCEgbWFpbHggLXMgImFsZXJ0IiBtZUB3b3JrLmNvbSAvdG1w L2FsZXJ0X2RhdGFfZmlsZQ0KDQo= From robjsargent@gmail.com Wed Aug 12 14:02:01 2009 Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 13BD463223F for ; Wed, 12 Aug 2009 11:02:01 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 09619-01 for ; Wed, 12 Aug 2009 14:01:41 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from out01.mta.xmission.com (out01.mta.xmission.com [166.70.13.231]) by mail.postgresql.org (Postfix) with ESMTP id CC97A633362 for ; Wed, 12 Aug 2009 11:01:18 -0300 (ADT) Received: from in02.mta.xmission.com ([166.70.13.52]) by out01.mta.xmission.com with esmtp (Exim 4.62) (envelope-from ) id 1MbEOS-0008EJ-N3; Wed, 12 Aug 2009 08:01:32 -0600 Received: from [208.187.158.94] (helo=[172.16.1.22]) by in02.mta.xmission.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1MbEOB-0000Zu-A7; Wed, 12 Aug 2009 08:01:15 -0600 Message-ID: <4A82CB26.3070208@gmail.com> Date: Wed, 12 Aug 2009 08:01:10 -0600 From: Rob Sargent User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: Jan Verheyden CC: 'Denis BUCHER' , "'pgsql-sql@postgresql.org'" References: <4A81F244.9070402@hsolutions.ch> <4A821D12.3050500@gmail.com> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-XM-SPF: eid=; ; ; mid=; ; ; hst=in02.mta.xmission.com; ; ; ip=208.187.158.94; ; ; frm=robjsargent@gmail.com; ; ; spf=neutral X-SA-Exim-Connect-IP: 208.187.158.94 X-SA-Exim-Rcpt-To: jan.verheyden@uz.kuleuven.ac.be, dbucherml@hsolutions.ch, pgsql-sql@postgresql.org, robjsargent@gmail.com X-SA-Exim-Mail-From: robjsargent@gmail.com X-Spam-DCC: XMission; sa01 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ;Jan Verheyden X-Spam-Relay-Country: Subject: Re: mail alert X-SA-Exim-Version: 4.2.1 (built Thu, 25 Oct 2007 00:26:12 +0000) X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.327 tagged_above=-10 required=5 tests=AWL=1.272, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200908/57 X-Sequence-Number: 32966 It looks to me like you want Dennis's #2. Lauch a mailer script from a trigger function. (Function can be any language you're familiar with including pgsql if you wish to take advantage of "\! your-mail-script" Jan Verheyden wrote: > Hi, > > I got a bit stuck... > I was looking for a solution for option a) > > Maybe I'll first explain the situation a bit more: > > I have one database for patient registration > Another one for image storage > And a third one for book keeping > A patient should be registered first before the images are stored, so if there is a new line in the second database with an id which does not exist yet, it has to be notified in the book keeping database. > > Now the questions: > 1) Can I do this with the inner join (tables subject_id from DB1, pat_id from DB2), there it is two different databases > 2) Once it is notified in the book keeping that is not registered yet, is it best to poll on this column to send a warning, or use a trigger?? > > Thanks!! > > > Jan > -----Original Message----- > From: Rob Sargent [mailto:robjsargent@gmail.com] > Sent: Wednesday, August 12, 2009 3:38 AM > To: Denis BUCHER > Cc: Jan Verheyden; 'pgsql-sql@postgresql.org' > Subject: Re: [SQL] mail alert > > Denis BUCHER wrote: > >> Hello, >> >> Jan Verheyden a écrit : >> >> >>> I was looking in what way it’s possible to alert via mail when some >>> conditions are true in a database. >>> >>> >> a) If the alert is not "very urgent" i.e. you can alter some minutes >> later I would do it like this : >> >> 1. Create a function that returns what you need, most importantly if the >> conditions are met >> >> 2. Create a script that does something like "SELECT * FROM function()..." >> >> b) If the email should be sent immediately, you could create a perl >> function in the database, launched by a TRIGGER and launching an >> "external" script... >> >> Therefore, first you have to know the requirements... >> >> Denis >> >> >> > see "check_postgres" for nagios-style monitoring > see \o /tmp/alert_data_file > and \! mailx -s "alert" me@work.com /tmp/alert_data_file > > From jan.verheyden@uz.kuleuven.ac.be Wed Aug 12 14:45:17 2009 Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 9D4156349E7 for ; Wed, 12 Aug 2009 11:45:17 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 20191-07-3 for ; Wed, 12 Aug 2009 14:44:57 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mx2.uzleuven.be (mx2-int.uzleuven.be [134.58.179.12]) by mail.postgresql.org (Postfix) with ESMTP id A7D8C6348AD for ; Wed, 12 Aug 2009 11:44:44 -0300 (ADT) X-AuditID: 863ab30b-b7b68ae00000636c-fc-4a82d55a4505 Received: from leo.uz.kuleuven.ac.be (Unknown_Domain [193.190.32.47]) by mx2.uzleuven.be (UZLeuven Mail Server) with SMTP id 56.57.25452.A55D28A4; Wed, 12 Aug 2009 16:44:42 +0200 (CEST) Received: from CONDOR.uz.kuleuven.ac.be (excclu21.uz.kuleuven.ac.be [172.22.3.45]) by leo.uz.kuleuven.ac.be (8.12.8/8.12.8) with ESMTP id n7CEig54025151; Wed, 12 Aug 2009 16:44:42 +0200 Received: from ex12-ch1-e.uz.kuleuven.ac.be ([172.22.3.107]) by CONDOR.uz.kuleuven.ac.be with Microsoft SMTPSVC(6.0.3790.1830); Wed, 12 Aug 2009 16:44:42 +0200 Received: from EX2007-MBX-2.uz.kuleuven.ac.be ([172.22.12.40]) by ex12-ch1-e.uz.kuleuven.ac.be ([172.22.3.107]) with mapi; Wed, 12 Aug 2009 16:44:41 +0200 From: Jan Verheyden To: "'Rob Sargent'" CC: "'Denis BUCHER'" , "'pgsql-sql@postgresql.org'" Date: Wed, 12 Aug 2009 16:44:41 +0200 Subject: Re: mail alert Thread-Topic: [SQL] mail alert Thread-Index: AcobVV1L/fqp3YY5RqeCI9+T81lQCQABbCTA Message-ID: References: <4A81F244.9070402@hsolutions.ch> <4A821D12.3050500@gmail.com> <4A82CB26.3070208@gmail.com> In-Reply-To: <4A82CB26.3070208@gmail.com> Accept-Language: nl-NL, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: nl-NL, en-US Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-OriginalArrivalTime: 12 Aug 2009 14:44:42.0281 (UTC) FILETIME=[6D46C990:01CA1B5B] X-Scanned-By: MIMEDefang 2.48 on 193.190.32.47 X-UZLTracking: ksdfkKHKYKPjnqsdKhlfd X-Brightmail-Tracker: AAAAAQAAAZE= X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.253 tagged_above=-10 required=5 tests=AWL=1.346, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200908/65 X-Sequence-Number: 32974 SGksDQoNCklzIGl0IHBvc3NpYmxlIHRvIHVzZSBwZ3NxbCBmb3IgY3JlYXRpbmcgYSBtYWlsZXIg c2NyaXB0Pz8NCkNhbiB5b3UgaGVscCBtZSBhcyB3ZWxs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2lvcy1zdHlsZSBtb25pdG9yaW5nDQo+IHNlZSBcbyAvdG1wL2FsZXJ0X2RhdGFfZmls ZQ0KPiBhbmQgXCEgbWFpbHggLXMgImFsZXJ0IiBtZUB3b3JrLmNvbSAvdG1wL2FsZXJ0X2RhdGFf ZmlsZQ0KPg0KPiAgIA0K From jasen@xnet.co.nz Thu Aug 13 21:23:55 2009 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; From jasen@xnet.co.nz Thu Aug 13 21:23:55 2009 Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 7C27F635825 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 46845-08 for ; Thu, 13 Aug 2009 21:23:52 +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 C2D7C634AC5 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 622A91098125 for ; Fri, 14 Aug 2009 09:23:09 +1200 (NZST) Received: from news by gonzo with local (Exim 4.69) (envelope-from ) id 1MbZED-0004dh-9e for pgsql-sql@postgresql.org; Fri, 14 Aug 2009 00:16:21 +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:16:21 GMT Organization: Dis (not Dat) Organisation Lines: 11 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 1250165781 17693 127.0.0.1 (13 Aug 2009 12:16:21 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.671 tagged_above=-10 required=5 tests=BAYES_20=-0.74, DATE_IN_PAST_06_12=1.069, RCVD_IN_DNSWL_LOW=-1 X-Spam-Level: X-Archive-Number: 200908/69 X-Sequence-Number: 32978 On 2009-08-12, Jan Verheyden wrote: > --_000_E30C7040DE22624185BAD4093190B54437BE5DB4A9EX2007MBX2uzk_ > Content-Type: text/plain; charset="us-ascii" > Content-Transfer-Encoding: quoted-printable > > It's on Windows > I'd go with notify and a listener written in C using c-client to send emails, but only because I've used those before. From alvherre@commandprompt.com Thu Aug 13 21:54:36 2009 Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id A382662DB8E for ; Thu, 13 Aug 2009 18:54:36 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 30567-05 for ; Thu, 13 Aug 2009 21:54:20 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from lists.commandprompt.com (host-159.commandprompt.net [207.173.203.159]) by mail.postgresql.org (Postfix) with ESMTP id CD61D63373A for ; Thu, 13 Aug 2009 18:54:25 -0300 (ADT) Received: from perhan.alvh.no-ip.org ([201.220.118.158]) (authenticated bits=0) by lists.commandprompt.com (8.13.8/8.13.8) with ESMTP id n7DLsN57028189 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 13 Aug 2009 14:54:26 -0700 Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 308AFD41A4; Thu, 13 Aug 2009 17:54:20 -0400 (CLT) Date: Thu, 13 Aug 2009 17:54:20 -0400 From: Alvaro Herrera To: Jasen Betts Cc: pgsql-sql@postgresql.org Subject: Re: mail alert Message-ID: <20090813215420.GU5909@alvh.no-ip.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0 (lists.commandprompt.com [207.173.203.159]); Thu, 13 Aug 2009 14:54:26 -0700 (PDT) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.904 tagged_above=-10 required=5 tests=AWL=0.695, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200908/70 X-Sequence-Number: 32979 Jasen Betts wrote: > On 2009-08-12, Jan Verheyden wrote: > > --_000_E30C7040DE22624185BAD4093190B54437BE5DB4A9EX2007MBX2uzk_ > > Content-Type: text/plain; charset="us-ascii" > > Content-Transfer-Encoding: quoted-printable > > > > It's on Windows > > > > I'd go with notify and a listener written in C using c-client to send > emails, but only because I've used those before. I wouldn't write it in C but rather Perl or Python, but whatever suits your fancy should work (Visual Basic anyone?). The advantages to using a listener program instead of doing it in a trigger or something like that are: - transaction semantics are kept; you don't send an email only to find out your transaction has been rolled back for whatever reason, and then send a second email when the transaction is replayed - you don't block the database system just because your mail server is down - the email can be sent on whatever schedule fits the listener program - the listener client can run elsewhere, not only in the database server - any further external processing can take place at that time, without bothering the database server - other stuff I don't recall ATM -- Alvaro Herrera http://www.CommandPrompt.com/ PostgreSQL Replication, Consulting, Custom Development, 24x7 support From tim@tim-landscheidt.de Thu Aug 13 22:24:26 2009 Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id CE2E2635688 for ; Thu, 13 Aug 2009 19:24:26 -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 71961-06-2 for ; Thu, 13 Aug 2009 22:24:23 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by mail.postgresql.org (Postfix) with ESMTP id 0F752635441 for ; Thu, 13 Aug 2009 19:24:23 -0300 (ADT) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1MbiiY-0001rz-RI for pgsql-sql@postgresql.org; Thu, 13 Aug 2009 22:24:18 +0000 Received: from e177123205.adsl.alicedsl.de ([85.177.123.205]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 13 Aug 2009 22:24:18 +0000 Received: from tim by e177123205.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 13 Aug 2009 22:24:18 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-sql@postgresql.org From: Tim Landscheidt Subject: Re: mail alert Date: Thu, 13 Aug 2009 22:24:07 +0000 Organization: Lines: 38 Message-ID: References: <20090813215420.GU5909@alvh.no-ip.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: e177123205.adsl.alicedsl.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:EaCg4d9Hcc1/WFx6NcoFaVGVBmY= X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-3.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599, RCVD_IN_DNSWL_LOW=-1 X-Spam-Level: X-Archive-Number: 200908/71 X-Sequence-Number: 32980 Alvaro Herrera wrote: >> > It's on Windows >> I'd go with notify and a listener written in C using c-client to send >> emails, but only because I've used those before. > I wouldn't write it in C but rather Perl or Python, but whatever suits > your fancy should work (Visual Basic anyone?). The advantages to using > a listener program instead of doing it in a trigger or something like > that are: > - transaction semantics are kept; you don't send an email only to find > out your transaction has been rolled back for whatever reason, and then > send a second email when the transaction is replayed > - you don't block the database system just because your mail server is > down > - the email can be sent on whatever schedule fits the listener program > - the listener client can run elsewhere, not only in the database server > - any further external processing can take place at that time, without > bothering the database server > - other stuff I don't recall ATM The main disadvantage in using a listener is that it is your responsibility to make sure that the listener is listening 24/7 - from before the database accepts other connections, through network failures, bugs, etc. - otherwise notifica- tions will be lost. Therefore I find it much more reliable (and easier to program) to copy the relevant data to a table "mailqueue" (or whatever) and then process that queue every other minute. Tim From alvherre@commandprompt.com Thu Aug 13 22:36:37 2009 Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 1A07763405D for ; Thu, 13 Aug 2009 19:36:37 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 38729-03 for ; Thu, 13 Aug 2009 22:36:20 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from lists.commandprompt.com (host-159.commandprompt.net [207.173.203.159]) by mail.postgresql.org (Postfix) with ESMTP id 5831A63356E for ; Thu, 13 Aug 2009 19:36:26 -0300 (ADT) Received: from perhan.alvh.no-ip.org ([201.220.118.158]) (authenticated bits=0) by lists.commandprompt.com (8.13.8/8.13.8) with ESMTP id n7DMaOBt031447 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 13 Aug 2009 15:36:27 -0700 Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id BB6DBD41A4; Thu, 13 Aug 2009 18:36:00 -0400 (CLT) Date: Thu, 13 Aug 2009 18:36:00 -0400 From: Alvaro Herrera To: Tim Landscheidt Cc: pgsql-sql@postgresql.org Subject: Re: mail alert Message-ID: <20090813223600.GW5909@alvh.no-ip.org> References: <20090813215420.GU5909@alvh.no-ip.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0 (lists.commandprompt.com [207.173.203.159]); Thu, 13 Aug 2009 15:36:27 -0700 (PDT) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.911 tagged_above=-10 required=5 tests=AWL=0.688, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200908/72 X-Sequence-Number: 32981 Tim Landscheidt wrote: > The main disadvantage in using a listener is that it is your > responsibility to make sure that the listener is listening > 24/7 - from before the database accepts other connections, > through network failures, bugs, etc. - otherwise notifica- > tions will be lost. Therefore I find it much more reliable > (and easier to program) to copy the relevant data to a table > "mailqueue" (or whatever) and then process that queue every > other minute. You just have to make sure the listener scans the table for possible events that were missed. Think of notifications as signals to wake up and check for possible work, not data carriers. The mailqueue table should still be there for the data. The only difference between your approach and mine is that you poll every minute instead of sleeping until getting a notification. If your system is going to be receiving notifications fairly frequently, it is probably better to stay with polling. (This is what Skype's replication system does, and Hannu Krossing says "what, are you going to optimize for the time when the server is idle?") -- Alvaro Herrera http://www.CommandPrompt.com/ PostgreSQL Replication, Consulting, Custom Development, 24x7 support From aklaver@comcast.net Thu Aug 13 23:30:55 2009 Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id BBC4F633132 for ; Thu, 13 Aug 2009 20:30:55 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 48266-01 for ; Thu, 13 Aug 2009 23:30:38 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from QMTA13.emeryville.ca.mail.comcast.net (qmta13.emeryville.ca.mail.comcast.net [76.96.27.243]) by mail.postgresql.org (Postfix) with ESMTP id 74754633F76 for ; Thu, 13 Aug 2009 20:30:44 -0300 (ADT) Received: from OMTA04.emeryville.ca.mail.comcast.net ([76.96.30.35]) by QMTA13.emeryville.ca.mail.comcast.net with comcast id TqXc1c00D0lTkoCADzWjFE; Thu, 13 Aug 2009 23:30:43 +0000 Received: from tucker.local ([24.17.164.54]) by OMTA04.emeryville.ca.mail.comcast.net with comcast id TzWi1c0011Ak4z48QzWi0N; Thu, 13 Aug 2009 23:30:42 +0000 From: Adrian Klaver To: pgsql-sql@postgresql.org Subject: Re: mail alert Date: Thu, 13 Aug 2009 16:30:41 -0700 User-Agent: KMail/1.9.10 References: <4A821D12.3050500@gmail.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200908131630.41508.aklaver@comcast.net> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.247 tagged_above=-10 required=5 tests=AWL=1.352, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200908/73 X-Sequence-Number: 32982 On Wednesday 12 August 2009 6:27:25 am Jan Verheyden wrote: > Hi, > > I got a bit stuck... > I was looking for a solution for option a) > > Maybe I'll first explain the situation a bit more: > > I have one database for patient registration > Another one for image storage > And a third one for book keeping > A patient should be registered first before the images are stored, so if > there is a new line in the second database with an id which does not exist > yet, it has to be notified in the book keeping database. > > Now the questions: > 1) Can I do this with the inner join (tables subject_id from DB1, pat_id > from DB2), there it is two different databases 2) Once it is notified in > the book keeping that is not registered yet, is it best to poll on this > column to send a warning, or use a trigger?? > > Thanks!! > If at all possible, try to move all that information into schema's of one database. As it stands now you have a lot of moving parts to keep track of via external processes. It is possible but you lose transactional support and trust me that turns into a royal pain. -- Adrian Klaver aklaver@comcast.net From cbbrowne@ca.afilias.info Fri Aug 14 15:21:20 2009 Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 19986632AE4 for ; Fri, 14 Aug 2009 12:21:20 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 78922-05 for ; Fri, 14 Aug 2009 15:21:09 +0000 (UTC) Received: from news.hub.org (news.hub.org [200.46.204.72]) by mail.postgresql.org (Postfix) with ESMTP id 6040C63266B for ; Fri, 14 Aug 2009 12:21:09 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.14.3/8.14.3) with ESMTP id n7EFL8HX030381 for ; Fri, 14 Aug 2009 12:21:08 -0300 (ADT) (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.14.3/8.14.3/Submit) id n7EFITkr026449 for pgsql-sql@postgresql.org; Fri, 14 Aug 2009 12:18:29 -0300 (ADT) (envelope-from news) From: Christopher Browne X-Newsgroups: pgsql.sql Subject: Re: mail alert Date: Fri, 14 Aug 2009 11:18:21 -0400 Organization: Hub.Org Networking Services Lines: 74 Message-ID: <87ab22qv9e.fsf@dba2.int.libertyrms.com> References: <20090813215420.GU5909@alvh.no-ip.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@news.hub.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:nv1bmq5sPE/HjV2lwY0H8m7gaGg= To: pgsql-sql@postgresql.org X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.74 tagged_above=-10 required=5 tests=BAYES_20=-0.74 X-Spam-Level: X-Archive-Number: 200908/80 X-Sequence-Number: 32989 tim@tim-landscheidt.de (Tim Landscheidt) writes: > Alvaro Herrera wrote: > >>> > It's on Windows > >>> I'd go with notify and a listener written in C using c-client to send >>> emails, but only because I've used those before. > >> I wouldn't write it in C but rather Perl or Python, but whatever suits >> your fancy should work (Visual Basic anyone?). The advantages to using >> a listener program instead of doing it in a trigger or something like >> that are: > >> - transaction semantics are kept; you don't send an email only to find >> out your transaction has been rolled back for whatever reason, and then >> send a second email when the transaction is replayed > >> - you don't block the database system just because your mail server is >> down > >> - the email can be sent on whatever schedule fits the listener program > >> - the listener client can run elsewhere, not only in the database server > >> - any further external processing can take place at that time, without >> bothering the database server > >> - other stuff I don't recall ATM > > The main disadvantage in using a listener is that it is your > responsibility to make sure that the listener is listening > 24/7 - from before the database accepts other connections, > through network failures, bugs, etc. - otherwise notifica- > tions will be lost. Therefore I find it much more reliable > (and easier to program) to copy the relevant data to a table > "mailqueue" (or whatever) and then process that queue every > other minute. Actually, I don't think there's any real disagreement here... - The *important* bit is to make sure that the data required to generate the email is queued in the database. - Whether you poll or use notify/listen is *way* less important. You could implement the "listener process" a number of ways: - It could be a "cron" that wakes up every so often to do whatever work is outstanding - It could be a "polling daemon" that sleeps for a while between iterations. That seems a little nicer than the "cron" approach in that it eliminates a troublesome scenario, namely the case where there's a lot of work to do (flooded queue?) so that processing takes longer than the polling interval, leading to the risk that a second "cron" starts up while the previous one is still working. - It could be a "listening daemon" that listens for notifications to indicate that work is outstanding That is a little better than the "polling daemon" in that it doesn't need to wait the full polling period to start processing new work. Any of those three approaches are quite viable, as long as you're careful to cover scenarios like: - daemon falling over - accidentally starting multiple "queue processors" -- output = reverse("ofni.sailifa.ac" "@" "enworbbc") Christopher Browne "Bother," said Pooh, "Eeyore, ready two photon torpedoes and lock phasers on the Heffalump, Piglet, meet me in transporter room three"