Re: MemoryContext and NodeTags - Mailing list pgsql-hackers

From Thomas Hallgren
Subject Re: MemoryContext and NodeTags
Date
Msg-id 4353B558.7040705@home.se
Whole thread Raw
In response to Re: MemoryContext and NodeTags  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: MemoryContext and NodeTags
List pgsql-hackers
tgl@sss.pgh.pa.us wrote:
> Thomas Hallgren <thomas.hallgren@home.se> writes:
>   
>> I have a proposal:
>> The NodeTag T_MemoryContext has the value of 600 and the next occupied 
>> entry is T_Value which is 650.
>> - Reserve half of that range for PostgreSQL specific contexts (today you 
>> only use one), and the other half for custom contexts.
>>     
>
> OK.
>
>   
>> - Accept patches to nodes/nodes.h for new custom tags (properly 
>> motivated of course).
>>     
>
> No.  Define 'em yourself.
>   
OK, I can do that. But I have a couple of reasons why I think that it 
would be a good idea to get my definitions into node.h:
- If more module authors want to do similar things, they would not risk 
defining overlapping tags.
- The NodeTag is an enum. Code that defines tags that are supposed to 
"fit in" becomes ugly.
- The IsA macro can be used.
- You (PostgreSQL core) want full control over the tags. If all tags are 
in nodes.h, you can move tags to other number ranges without creating a 
hassle for people like me.

Regards,
Thomas Hallgren.



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: MemoryContext and NodeTags
Next
From: Tom Lane
Date:
Subject: Re: MemoryContext and NodeTags