Re: MemoryContext and NodeTags

From: Thomas Hallgren <thomas(dot)hallgren(at)home(dot)se>
To: tgl(at)sss(dot)pgh(dot)pa(dot)us
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: MemoryContext and NodeTags
Date: 2005-10-17 15:15:32
Message-ID: 4353C014.2080108@home.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dave Page 2005-10-17 15:27:13 Re: More problems with the win32 installer for 8.1 beta3
Previous Message Tony Caduto 2005-10-17 14:52:31 More problems with the win32 installer for 8.1 beta3