Robert Haas <robertmh...@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