[PATCH] fix DROP OPERATOR to reset links to itself on commutator and negator

Поиск
Список
Период
Сортировка
От Roma Sokolov
Тема [PATCH] fix DROP OPERATOR to reset links to itself on commutator and negator
Дата
Msg-id A0DF8607-A1A1-40CE-B152-82FC91EF8A3A@gmail.com
обсуждение исходный текст
Ответы Re: [PATCH] fix DROP OPERATOR to reset links to itself on commutator and negator  (Euler Taveira <euler@timbira.com.br>)
Re: [PATCH] fix DROP OPERATOR to reset links to itself on commutator and negator  (Michael Paquier <michael.paquier@gmail.com>)
Список pgsql-hackers
Hello, hackers!

As was mentioned in that message [1], and earlier in [2], DROPping OPERATOR with
negator or commutator doesn't update respective fields (oprnegate and oprcom) on
them. While this issue is probably not very frequent, this behaviour leaves
database in inconsistent state and prevents from using former negator or
commutator.

Proposed patch fixes unwanted behaviour by reseting oprnegate and oprcom fields
to InvalidOid when deleting operator. Code updates tries to update other
operators only if necessary, and only if negator or commutator have target oid
in their respective fields.

To implement desired behaviour with as little code as possible, OperatorUpd
function is extended to accept additional parameter and made externally visible.
It's used from RemoveOperatorById, after checking that update is indeed needed.

Regression tests are added to check DROP OPERATOR behaves as intended (including
case with self-commutator and unlikely case with operator being both negator and
commutator).

Should this patch be added to CommitFest?

[1] — http://www.postgresql.org/message-id/CA+TgmoYThtZZf6yhnq22SZPw7OTiT68iu9wvvidb2Jz50KdAnQ@mail.gmail.com
[2] — http://www.postgresql.org/message-id/15208.1285772173@sss.pgh.pa.us

Cheers,
Roma


Вложения

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

Предыдущее
От: Kartyshov Ivan
Дата:
Сообщение: proposal: get oldest LSN - function
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Performance degradation in commit 6150a1b0