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 6D9B8329D69 for ; Wed, 15 Sep 2004 17:03:28 +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 92873-01 for ; Wed, 15 Sep 2004 16:03:23 +0000 (GMT) Received: from mproxy.gmail.com (rproxy.gmail.com [64.233.170.199]) by svr1.postgresql.org (Postfix) with ESMTP id 54F84329C6B for ; Wed, 15 Sep 2004 17:03:22 +0100 (BST) Received: by mproxy.gmail.com with SMTP id 77so238139rnl for ; Wed, 15 Sep 2004 09:03:11 -0700 (PDT) Received: by 10.38.96.16 with SMTP id t16mr656983rnb; Wed, 15 Sep 2004 09:03:11 -0700 (PDT) Received: by 10.38.126.6 with HTTP; Wed, 15 Sep 2004 09:03:11 -0700 (PDT) Message-ID: Date: Wed, 15 Sep 2004 12:03:11 -0400 From: Mike Rylander Reply-To: Mike Rylander To: Iain Subject: Re: implementing an out-of-transaction trigger Cc: pgsql-sql@postgresql.org In-Reply-To: <002f01c49ad0$9491e180$7201a8c0@mst1x5r347kymb> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <002f01c49ad0$9491e180$7201a8c0@mst1x5r347kymb> 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/111 X-Sequence-Number: 18957 >I've come across a situation where I'd like to use some kind of "out-of-transaction >trigger" to do some processing after changes to some tables, but without extending >the duration of the main transaction. Of course, it's important that the processing be >completed so it has to be, as far as possible, reliable and "safe". The extra >processing should be completed within a reasonable time after the original >transaction, but it needn't happen immediately. Check out http://www.postgresql.org/docs/7.4/static/sql-listen.html and http://www.postgresql.org/docs/7.4/static/sql-notify.html Then look at the Rules system for generating a NOTIFY: http://www.postgresql.org/docs/7.4/static/sql-createrule.html --miker