Re: pg_index question

Поиск
Список
Период
Сортировка
От Scott Marlowe
Тема Re: pg_index question
Дата
Msg-id 1111787556.12450.14.camel@state.g2switchworks.com
обсуждение исходный текст
Ответ на pg_index question  (Terry Lee Tucker <terry@esc1.com>)
Список pgsql-general
On Fri, 2005-03-25 at 15:10, Terry Lee Tucker wrote:
> Hi,
>
> If I were to set the value of pg_class.indisunique on a unique index to False
> inside a transaction so I could juggle sequence numbers around on a table
> with a unique two element index, and then set it back again to its proper
> value, all in the same transaction, would that allow me to temorarily
> override the unique index behavior? Is it safe to temporarily change the
> value of that column?

You could, but, in order to ensure there are no duplicates, you'd have
to check after turning it back on to see if there were and delete them
by some logic that made sense for your transactional methodologies.

I wouldn't recommend it really, because I'm willing to bet there are
race conditions I'm not thinking of that could bite you in the behind.

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

Предыдущее
От: Terry Lee Tucker
Дата:
Сообщение: Re: pg_index question
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: pg_index question