X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id E47F2D1D8BF for ; Wed, 21 Apr 2004 08:03:51 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 06735-08 for ; Wed, 21 Apr 2004 08:03:51 -0300 (ADT) Received: from fep02-mail.bloor.is.net.cable.rogers.com (fep02-mail.bloor.is.net.cable.rogers.com [66.185.86.72]) by svr1.postgresql.org (Postfix) with ESMTP id 3114BD1D206 for ; Wed, 21 Apr 2004 08:03:48 -0300 (ADT) Received: from phlogiston.dydns.org ([65.49.125.184]) by fep02-mail.bloor.is.net.cable.rogers.com (InterMail vM.5.01.05.12 201-253-122-126-112-20020820) with ESMTP id <20040421101253.CHBB67423.fep02-mail.bloor.is.net.cable.rogers.com@phlogiston.dydns.org> for ; Wed, 21 Apr 2004 06:12:53 -0400 Received: by phlogiston.dydns.org (Postfix, from userid 1000) id 11D3E3BEC; Wed, 21 Apr 2004 06:13:27 -0400 (EDT) Date: Wed, 21 Apr 2004 06:13:27 -0400 From: Andrew Sullivan To: pgsql-sql@postgresql.org Subject: Re: transaction Message-ID: <20040421101327.GA31729@phlogiston.dyndns.org> Mail-Followup-To: pgsql-sql@postgresql.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.5.1+cvs20040105i X-Authentication-Info: Submitted using SMTP AUTH LOGIN at fep02-mail.bloor.is.net.cable.rogers.com from [65.49.125.184] using ID at Wed, 21 Apr 2004 06:12:53 -0400 X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.4 tagged_above=0.0 required=5.0 tests=RCVD_IN_SORBS, UPPERCASE_25_50 X-Spam-Level: X-Archive-Number: 200404/202 X-Sequence-Number: 17577 On Tue, Apr 20, 2004 at 09:14:48PM +0200, H.J. Sanders wrote: > > - BEGIN WORK > > - INSERT ROW > > - IF FAILED THEN UPDATE ROW > > - COMMIT WORK You can do it the other way. Begin, update; if 0 rows are updated then insert. A -- Andrew Sullivan | ajs@crankycanuck.ca