Re: Atomicity of UPDATE, interchanging values in unique

From: Rod Taylor <rbt(at)rbt(dot)ca>
To: daniel alvarez <d-alvarez(at)gmx(dot)de>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Atomicity of UPDATE, interchanging values in unique
Date: 2003-03-08 21:56:11
Message-ID: 1047160571.28251.202.camel@jester
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)rbt(dot)ca>

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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2003-03-08 22:10:44 Re: Atomicity of UPDATE, interchanging values in unique
Previous Message daniel alvarez 2003-03-08 21:48:46 Re: Atomicity of UPDATE, interchanging values in unique column