Re: Is custom MemoryContext prohibited?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Is custom MemoryContext prohibited?
Дата
Msg-id 8024.1580922943@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Is custom MemoryContext prohibited?  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Is custom MemoryContext prohibited?  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> I don't disagree with the factual statements that you are making but I
> don't understand why any of them represent real problems.

The core problem that I'm unhappy about is that what you want to do
adds cognitive burden (including an increased risk of mistakes) and
extra debugging commands in common cases around inspecting memory
contexts in a debugger.  Sure, it's not a fatal problem, but it's
still a burden.  I judge that putting an enum into the struct would
greatly reduce that burden at very small cost.

The point of the magic number, AIUI, is so that we can still have an
equivalent of Assert(IsA(MemoryContext)) in the code in appropriate
places.  That need doesn't require readability in a debugger, which is
why I'm okay with it being a random magic number.  But there's still
a need for debugger-friendliness, and a constant string that you need
to use extra commands to see doesn't solve that end of the problem.
IMO anyway.

            regards, tom lane



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

Предыдущее
От: Mark Dilger
Дата:
Сообщение: Re: [HACKERS] advanced partition matching algorithm forpartition-wise join
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Documentation patch for ALTER SUBSCRIPTION