X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 31280329D03 for ; Thu, 16 Sep 2004 06:15:53 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 43886-05 for ; Thu, 16 Sep 2004 05:15:51 +0000 (GMT) Received: from millenium.mst.co.jp (unknown [210.230.185.241]) by svr1.postgresql.org (Postfix) with ESMTP id 15D0D329CFB for ; Thu, 16 Sep 2004 06:15:50 +0100 (BST) Received: from mst1x5r347kymb (lc12114 [192.168.1.114]) by millenium.mst.co.jp (8.11.6p2/3.7W) with SMTP id i8G5Fgq02304; Thu, 16 Sep 2004 14:15:42 +0900 Message-ID: <00ba01c49bac$358511d0$7201a8c0@mst1x5r347kymb> From: "Iain" To: "Greg Stark" Cc: "Mike Rylander" , References: <002f01c49ad0$9491e180$7201a8c0@mst1x5r347kymb><008c01c49b91$361e86f0$7201a8c0@mst1x5r347kymb> <87sm9irhl8.fsf@stark.xeocode.com> Subject: Re: implementing an out-of-transaction trigger Date: Thu, 16 Sep 2004 14:15:39 +0900 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200409/114 X-Sequence-Number: 18960 Hi Greg, I would have like to have avoided writing a daemon if possible, but presumably it should be possible to write one flexible enough to be used in a variety of situations. If I didn't use notify, I'd would just be checking for the presence of data in "transfer areas" or queue tables as you called them on a periodic basis. This wouldn't change so much using notify, except that instead of writing the process so as to sleep and periodically check, I can just have it wake up when the data actually gets there. A minor saving perhaps, but at least I could use the name of the notification to determine what processing to activate. Thanks, Iain ----- Original Message ----- From: "Greg Stark" To: "Iain" Cc: "Mike Rylander" ; Sent: Thursday, September 16, 2004 12:57 PM Subject: Re: [SQL] implementing an out-of-transaction trigger > > "Iain" writes: > > > Though, as far as I can tell, there is no way to have the notify activate a > > pl/pgsql function directly. I'll still need to write a client program to > > create a session and actually do the listening, that is if I havn't missed > > anything else... > > Right, presumably some sort of daemon that sits and waits for events. Much > like you would have with Oracle advanced queuing and such. > > The big difference is that NOTIFY doesn't pass along any parameters. You will > need some way for your daemon to find any pending data it needs to process. > You might need some kind of queue table, or you might be able to get by > without one. > > -- > greg