Re: UPDATE has a bug to update tables with an index of 2 columns

Поиск
Список
Период
Сортировка
От Andreas Schmitz
Тема Re: UPDATE has a bug to update tables with an index of 2 columns
Дата
Msg-id 3EC668F2.3000808@as-dataservice.de
обсуждение исходный текст
Ответ на UPDATE has a bug to update tables with an index of 2 columns  (Andreas Schmitz <andreas.schmitz@as-dataservice.de>)
Ответы Re: UPDATE has a bug to update tables with an index of 2 columns  (Bruno Wolff III <bruno@wolff.to>)
Список pgsql-bugs
Stephan Szabo wrote:

>On Sat, 17 May 2003, Andreas Schmitz wrote:
>
>
>
>>Stephan Szabo wrote:
>>
>>
>>
>>>On Sat, 17 May 2003, Ian Barwick wrote:
>>>
>>>
>>>
>>>
>>>
>>>>On Friday 16 May 2003 21:46, Andreas Schmitz wrote:
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>Please enter a FULL description of your problem:
>>>>>------------------------------------------------
>>>>>
>>>>>Short: UPDATE has a bug to update tables with an index of 2 columns
>>>>>
>>>>>
>>>>>
>>>>>
>>>>(...)
>>>>
>>>>
>>>>
>>>>
>>>>>update test2 set v2=v2+2;
>>>>>ERROR:  Duplizierter Wert kann nicht in ?Unique?-Index uq_test
>>>>>       eingef?gt werden
>>>>>
>>>>>
>>>>>
>>>>>
>>>>-> "Cannot insert a duplicate key into unique index uq_test"
>>>>
>>>>I would contend this is not a bug but a feature (or at most
>>>>not-yet-implemented functionality, i.e. no ability to defer
>>>>constraints other than foreign keys).
>>>>
>>>>
>>>>
>>>>
>>>IIRC, it's a known bug.  The constraint is checked at the wrong time, even
>>>for non-deferred unique constraints the check is supposed to happen after
>>>all the rows have been changed not as the rows are being changed.
>>>
>>>
>
>No.  It's going to take some infrastructure work to change. Unless someone
>with a clue about the index code and time works on it, I wouldn't expect
>it for 7.4.  Fundamentally the issue is that you'd have to make changes to
>the index code to allow duplicates in unique indexes, provide some way to
>check at statement end to make sure the duplicates have been resolved and
>store the information necessary to do so (since you wouldn't want to walk
>the entire index in general) or some other mechanism with the same final
>result.
>
>
Oh, this is not so beautifull. Is there a way to work around without
dropping the unique index? Perhaps disabling the index, but only for the
current session?

Or any other ideas or do you approximately know the releasedate of 7.4?

Thanx a lot for your Help.

Best regards
--
Andreas Schmitz
AS-DataService <http://www.as-dataservice.de>
Kastanienallee 24
D-54662 Speicher

Tel.: (0 65 62) 93 05 17
Fax: (0 65 62) 93 05 18
Email: andreas.schmitz@as-dataservice.de
<mailto:andreas.schmitz@as-dataservice.de>

Ust-IdNr.: DE211466407
Handelsregister: HRA 1869 - Amtsgericht Bitburg
<http://www.as-dataservice.de>

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

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: UPDATE has a bug to update tables with an index of 2
Следующее
От: Bruno Wolff III
Дата:
Сообщение: Re: UPDATE has a bug to update tables with an index of 2 columns