Re: Atomicity of UPDATE, interchanging values in unique - Mailing list pgsql-sql

From Rod Taylor
Subject Re: Atomicity of UPDATE, interchanging values in unique
Date
Msg-id 1047160571.28251.202.camel@jester
Whole thread Raw
In response to Re: Atomicity of UPDATE, interchanging values in unique column  (daniel alvarez <d-alvarez@gmx.de>)
Responses Re: Atomicity of UPDATE, interchanging values in unique  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
On Sat, 2003-03-08 at 16:48, daniel alvarez wrote:
> > The first is what you want.  PostgreSQL needs some work in the
> > evaluation of unique indexes to properly support it.
> >
> > Namely, when it sees a conflict when inserting into the index, it needs
> > to record the fact, and revisit the conflict at the end of the command.
> > Lots of work...
>
> OK. The long-term goal would then be to get rid of such oddities. But what
> can I do right now as a user to solve that issue for my application?

Certainly.. But you have to find someone willing to do a the work for
little gain. There are lots of issues more important to most of the
developers.

> There must be a better solution than the additional dummy update.

You could try hiding it behind a function, but I'm afraid thats the only
sane way to do it.  Select into temp table, delete both, and insert
values back in again is another :)

--
Rod Taylor <rbt@rbt.ca>

PGP Key: http://www.rbt.ca/rbtpub.asc

pgsql-sql by date:

Previous
From: daniel alvarez
Date:
Subject: Re: Atomicity of UPDATE, interchanging values in unique column
Next
From: Tom Lane
Date:
Subject: Re: Atomicity of UPDATE, interchanging values in unique