Re: defferable update & unique

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Ben-Nes Michael <miki(at)canaan(dot)co(dot)il>, postgresql <pgsql-general(at)postgresql(dot)org>
Subject: Re: defferable update & unique
Date: 2003-11-19 17:12:56
Message-ID: 20031119091057.V86804@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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;

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Lamar Owen 2003-11-19 17:18:29 Re: SuSE RPMs available for PostgreSQL 7.4
Previous Message Greg Stark 2003-11-19 17:08:52 Re: defferable update & unique