Re: deferring/disabling unique index
| От | Bruce Momjian |
|---|---|
| Тема | Re: deferring/disabling unique index |
| Дата | |
| Msg-id | 200401091745.i09Hj4h14349@candle.pha.pa.us обсуждение исходный текст |
| Ответ на | Re: deferring/disabling unique index ("Joshua D. Drake" <jd@commandprompt.com>) |
| Список | pgsql-general |
Joshua D. Drake wrote:
>
> >So, does it mean that the only way to disable the index is to drop and
> >recreate it? What about setting indisunique to false temporarily?
> >
> >
> >
> I am just curious... why would you want to defer a unique constraint?
I remember now --- if you do:
UPDATE tab SET col = col + 1;
you hit a unique constraint when you shouldn't need to. I think the
workaround was:
UPDATE tab SET col = -col + -1;
then:
UPDATE tab SET col = -col;
This assumes all the values are positive, of course.
--
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 по дате отправления: