Re: MemoryContext and NodeTags - Mailing list pgsql-hackers

From Thomas Hallgren
Subject Re: MemoryContext and NodeTags
Date
Msg-id 4353C014.2080108@home.se
Whole thread Raw
In response to Re: MemoryContext and NodeTags  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
tgl@sss.pgh.pa.us wrote:
>
> Not much of an extension mechanism, is it?
>
>   
Yes it is. If you are a module writer and want to define your own tag, 
the chances are pretty hight that you would look for available tags in 
the current CVS HEAD before you go ahead, thus avoiding any collision. 
First come, first served. You will of course need #ifdef's for backward 
compatibility but at some point in time, they can be removed (as I now 
do with a lot of stuff for 7.x and custom variable classes as I'm 
dropping the 7.x support).

If you don't get your tag accepted then you're on your own of course. 
Then again, if the core team has reservations to accepting your tag 
there's a bigger problem somewhere.
> I don't see anyone trying to "switch" over MemoryContext tags, so this
> is really pretty irrelevant.  AFAICS it should work just fine to do
>
> #define T_FooNode  ((NodeTag) (T_FirstPrivateNode + 1))
>   
I don't see how #define rectifies ugliness. It's horrible in the 
debugger and it screws up code-completion etc. in any IDE. Not being 
able to use a "switch" is a minor problem.

>> - 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.
>>     
>
> As long as you define your tag as T_Something + N, that still holds.
>   
No, that's false. Assume a range is full and you need to expand it. 
Someone within that range has to move. Everyone uses the same T_Something...

Regards,
Thomas Hallgren



pgsql-hackers by date:

Previous
From: Tony Caduto
Date:
Subject: More problems with the win32 installer for 8.1 beta3
Next
From: "Dave Page"
Date:
Subject: Re: More problems with the win32 installer for 8.1 beta3