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 9BE91D1B4B2 for ; Tue, 20 Apr 2004 22:56:12 -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 24215-03 for ; Tue, 20 Apr 2004 22:56:12 -0300 (ADT) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id 1E2D8D1B7F0 for ; Tue, 20 Apr 2004 22:56:09 -0300 (ADT) Received: (qmail 20058 invoked by uid 500); 21 Apr 2004 02:00:10 -0000 Date: Tue, 20 Apr 2004 21:00:10 -0500 From: Bruno Wolff III To: "H.J. Sanders" Cc: pgsql-sql@postgresql.org Subject: Re: transaction Message-ID: <20040421020010.GA19910@wolff.to> Mail-Followup-To: "H.J. Sanders" , 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.6i X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200404/196 X-Sequence-Number: 17571 On Tue, Apr 20, 2004 at 21:14:48 +0200, "H.J. Sanders" wrote: > > Hello list. > > We are migrating from Informix to PSQL. > > In Informix we used to do: > > - BEGIN WORK > > - INSERT ROW > > - IF FAILED THEN UPDATE ROW > > - COMMIT WORK > > > In PSQL this does not seem to work because after the first error (the > insert) > everything is omitted. > > Has someone found a solution for this (we have 1000's of this type). This question has come up a few times over the last year and there isn't a great answer. Locking the table is a simple solution, but can lead to problems because of contention.