Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 4BE87B5DBE0 for ; Wed, 7 Sep 2011 17:05:03 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 73252-03 for ; Wed, 7 Sep 2011 20:04:57 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.yitter.info (mail.yitter.info [208.86.224.201]) by mail.postgresql.org (Postfix) with ESMTP id 99F0FB5DBD6 for ; Wed, 7 Sep 2011 17:04:56 -0300 (ADT) Received: from shinkuro.com (69-196-144-227.dsl.teksavvy.com [69.196.144.227]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.yitter.info (Postfix) with ESMTPSA id 3724A1ECB41D for ; Wed, 7 Sep 2011 20:04:54 +0000 (UTC) Date: Wed, 7 Sep 2011 16:04:54 -0400 From: Andrew Sullivan To: pgsql-general@postgresql.org Subject: Re: conditional insert Message-ID: <20110907200454.GV35347@shinkuro.com> Mail-Followup-To: Andrew Sullivan , pgsql-general@postgresql.org References: <4E64A79E.7030503@compulab.co.il> <4E64AC45.6030704@rem.nl> <20110906190548.433E8B5DBD1@mail.postgresql.org> <4e679195.12848e0a.019e.ffff918eSMTPIN_ADDED@mx.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201109/195 X-Sequence-Number: 179553 On Wed, Sep 07, 2011 at 02:51:32PM -0500, Merlin Moncure wrote: > > @andrew s: going SERIALIZABLE doesn't help if you trying to eliminate > cases that would push you into retrying the transaction. Well, no, of course. But why not catch the failure and retry? I guess I just don't get the problem, since I hear people say this all the time. (I mean, I've also seen places where 'upsert' would be cool, but it doesn't seem trivial to do in a general way and you can do this with catch-serialization-error-and-retry, I think?) A -- Andrew Sullivan ajs@crankycanuck.ca