incrementing without violating a constraint

Поиск
Список
Период
Сортировка
От Michael P. Soulier
Тема incrementing without violating a constraint
Дата
Msg-id 20140120143357.GN23196@mitel.com
обсуждение исходный текст
Ответы Re: incrementing without violating a constraint  ("Michael P. Soulier" <michael_soulier@mitel.com>)
Re: incrementing without violating a constraint  (Andreas Kretschmer <andreas@a-kretschmer.de>)
Re: incrementing without violating a constraint  (Alban Hertroys <haramrae@gmail.com>)
Список pgsql-general
Hi,

I have a uniqueness constraint on an integer value in a table where I would
like to mass increment all of the existing rows.

ie.
update rules set rule_number = rule_number + 1;

This violates the uniquness constraint. Is there a way to say, turn off the
constraint, run the update and then turn it back on?

Thanks,
Mike

Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: Albe Laurenz
Дата:
Сообщение: Re: to_date() and invalid dates
Следующее
От: "Michael P. Soulier"
Дата:
Сообщение: Re: incrementing without violating a constraint