Re: defferable update & unique
От | Bruce Momjian |
---|---|
Тема | Re: defferable update & unique |
Дата | |
Msg-id | 200311191738.hAJHcQI01759@candle.pha.pa.us обсуждение исходный текст |
Ответ на | Re: defferable update & unique (Stephan Szabo <sszabo@megazone.bigpanda.com>) |
Список | pgsql-general |
Stephan Szabo wrote: > 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; Excellent idea. You might want to add a VACUUM in there: > update table set u_test=-u_test-1; > VACUUM > update table set u_test=-u_test; > VACUUM -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073
В списке pgsql-general по дате отправления: