Re: Moving from MySQL to PGSQL....some questions (multilevel - Mailing list pgsql-general

From Michael Chaney
Subject Re: Moving from MySQL to PGSQL....some questions (multilevel
Date
Msg-id 20040305021037.GC15229@michaelchaney.com
Whole thread Raw
In response to Re: Moving from MySQL to PGSQL....some questions (multilevel  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Moving from MySQL to PGSQL....some questions (multilevel
List pgsql-general
On Thu, Mar 04, 2004 at 10:50:50AM -0500, Tom Lane wrote:
> If I understood the requirements correctly, it might be sufficient to
> put a unique index on (id1,id2).  If two transactions simultaneously try
> to insert for the same id1, one would get a duplicate-index-entry
> failure, and it would have to retry.  The advantage is you take no
> table-wide lock.  So if the normal usage pattern involves lots of
> concurrent inserts for different id1 values, you'd come out ahead.
> Whether that applies, or is worth the hassle of a retry loop in the
> application, I can't tell from the info we've been given.

Not a bad idea, but probably best to move it into a stored procedure in
that case.

Michael
--
Michael Darrin Chaney
mdchaney@michaelchaney.com
http://www.michaelchaney.com/

pgsql-general by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: ERROR: function round(double precision, integer) does
Next
From: "Glen Parker"
Date:
Subject: Re: ERROR: function round(double precision, integer) does