Re: defferable update & unique - Mailing list pgsql-general

From Stephan Szabo
Subject Re: defferable update & unique
Date
Msg-id 20031119091057.V86804@megazone.bigpanda.com
Whole thread Raw
In response to Re: defferable update & unique  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: defferable update & unique
List pgsql-general
On Wed, 19 Nov 2003, Bruce Momjian wrote:

> Ben-Nes Michael wrote:
> > Hi All
> >
> > Does 7.4 support defferable updates on unique column ?
> >
> > example
> >
> > unique INT colum named u_test has the following values: 1, 2, 3, 4, 5
> >
> > can i do update table set u_test = u_test + 1;
>
> No, this is on our TODO list.  Also, I can't think of a workaround.  :-(

If negative values aren't allowed normally, I think you can do it in an
ugly fashion through two updates, something like:

update table set u_test=-u_test-1;
update table set u_test=-u_test;


pgsql-general by date:

Previous
From: Lamar Owen
Date:
Subject: Re: SuSE RPMs available for PostgreSQL 7.4
Next
From: Greg Stark
Date:
Subject: Re: defferable update & unique