From: James Mansion <james@mansionfamily.plus.com>
To: Stephen Denne <Stephen.Denne@datamail.co.nz>
Cc: Ravi Chemudugunta <chemuduguntar@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Performance Implications of Using Exceptions
Date: Wed, 02 Apr 2008 20:19:54 +0100
Message-ID: <47F3DC5A.30705@mansionfamily.plus.com> (raw)
In-Reply-To: <F0238EBA67824444BC1CB4700960CB4804F8B1BA@dmpeints002.isotach.com>
References: <7a4208ef0803311720s1dac8362gff2477d3dc534968@mail.gmail.com>
<20080401005235.GM4999@tamriel.snowman.net>
<F0238EBA67824444BC1CB4700960CB4804F8B1BA@dmpeints002.isotach.com>
Stephen Denne wrote:
> A third option is to update, if not found, insert.
>
>
I find myself having to do this in Sybase, but it sucks because there's
a race - if there's no row updated then there's no lock and you race
another thread doing the same thing. So you grab a row lock on a
sacrificial row used as a mutex, or just a table lock. Or you just
accept that sometimes you have to detect the insert fail and retry the
whole transaction. Which is sucky however you look at it.
I think the 'update or insert' or 'merge' extensions make a degree
of sense. At least in psql one can use the lightweight lock manager.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: james@mansionfamily.plus.com, Stephen.Denne@datamail.co.nz, chemuduguntar@gmail.com
Subject: Re: Performance Implications of Using Exceptions
In-Reply-To: <47F3DC5A.30705@mansionfamily.plus.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox