Re: Is custom MemoryContext prohibited? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Is custom MemoryContext prohibited?
Date
Msg-id 8024.1580922943@sss.pgh.pa.us
Whole thread Raw
In response to Re: Is custom MemoryContext prohibited?  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Is custom MemoryContext prohibited?
List 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 by date:

Previous
From: Mark Dilger
Date:
Subject: Re: [HACKERS] advanced partition matching algorithm forpartition-wise join
Next
From: Alvaro Herrera
Date:
Subject: Re: Documentation patch for ALTER SUBSCRIPTION