Received: from localhost (unknown [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id D76FC2E0309 for ; Fri, 18 Jan 2008 11:26:43 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 50340-10 for ; Fri, 18 Jan 2008 11:26:24 -0400 (AST) Received: from lists.commandprompt.com (host-159.commandprompt.net [207.173.203.159]) by postgresql.org (Postfix) with ESMTP id ADEAA2E00A1 for ; Fri, 18 Jan 2008 11:26:36 -0400 (AST) Received: from perhan.alvh.no-ip.org (200-126-113-152.bk8-dsl.surnet.cl [200.126.113.152]) (authenticated bits=0) by lists.commandprompt.com (8.13.8/8.13.8) with ESMTP id m0IFQZKU002569 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 18 Jan 2008 07:26:38 -0800 Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 81C0247BC7; Fri, 18 Jan 2008 12:26:25 -0300 (CLST) Date: Fri, 18 Jan 2008 12:26:25 -0300 From: Alvaro Herrera To: Gerardo Herzig Cc: Filip =?utf-8?Q?Rembia=C5=82kowski?= , pgsql-sql@postgresql.org Subject: Re: transaction and triggers Message-ID: <20080118152625.GE5326@alvh.no-ip.org> References: <4790B50A.5050101@fmed.uba.ar> <92869e660801180642i1fdd417r3d3b9399c5e5ab98@mail.gmail.com> <4790C2B4.1070103@fmed.uba.ar> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4790C2B4.1070103@fmed.uba.ar> User-Agent: Mutt/1.5.17 (2007-11-01) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0 (lists.commandprompt.com [207.173.203.159]); Fri, 18 Jan 2008 07:26:38 -0800 (PST) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200801/151 X-Sequence-Number: 30004 Gerardo Herzig escribió: > Right. But today, that trigger do some other work, wich includes writing > some files to disk, so there is my problem. Crap, i guess i will have to > review the main logic. Probably it's better to move the actual file writing to a listener external process -- the transaction only does a NOTIFY, which is certain to be delivered only when the transaction commits. So if it aborts, no spurious write occurs. -- Alvaro Herrera http://www.CommandPrompt.com/ PostgreSQL Replication, Consulting, Custom Development, 24x7 support