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 CBE5553608 for ; Sun, 27 Mar 2005 17:20:34 +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 51180-09 for ; Sun, 27 Mar 2005 16:20:29 +0000 (GMT) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.202]) by svr1.postgresql.org (Postfix) with ESMTP id CDF95534FA for ; Sun, 27 Mar 2005 17:20:28 +0100 (BST) Received: by rproxy.gmail.com with SMTP id c51so1136937rne for ; Sun, 27 Mar 2005 08:20:27 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=Ho+/NFNUCdV/x2yhRlkIM7YVEXax620/fD5N5JmhjLctZVDlOM3qsmqjyM20gscQ++0OsCwo7icLkb+3324TrjzZ4205A7iR/dNpbb5ix2TzPZoshnZItuJwbnPIDiqjEE2gyvhuqeL+BkLvo98sp1QfPzINsMgw3ClKSdZRS9g= Received: by 10.38.163.7 with SMTP id l7mr4029815rne; Sun, 27 Mar 2005 08:20:27 -0800 (PST) Received: by 10.38.126.9 with HTTP; Sun, 27 Mar 2005 08:20:27 -0800 (PST) Message-ID: Date: Sun, 27 Mar 2005 16:20:27 +0000 From: Mike Rylander Reply-To: Mike Rylander To: weigelt@metux.de Subject: Re: detaching triggers Cc: pgsql-sql In-Reply-To: <20050327154102.GA16122@nibiru.borg.metux.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit References: <20050327154102.GA16122@nibiru.borg.metux.de> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.246 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, RCVD_BY_IP X-Spam-Level: X-Archive-Number: 200503/360 X-Sequence-Number: 20839 On Sun, 27 Mar 2005 17:41:02 +0200, Enrico Weigelt wrote: > > Hi folks, > > is it somehow possible to detach trigger, so the calling transaction > can return immediately, even before the trigger function has > returned. No, but see below. > The only solution I currently know is to fill somethings in a queue > table by rule and have an external daemon looking at it every second. > But this doesnt seem very optimal for me. Take a look at the LISTEN/NOTIFY interfaces in the docs. This will allow async post-transaction processing. You can set up an ALSO rule to notify when a particular type of statement has executed against your target table. http://www.postgresql.org/docs/8.0/static/sql-listen.html http://www.postgresql.org/docs/8.0/static/sql-notify.html See the bottom of: http://www.postgresql.org/docs/8.0/static/sql-createrule.html Hope that helps! -- Mike Rylander mrylander@gmail.com GPLS -- PINES Development Database Developer http://open-ils.org