Is "Window" really safe as a global typedef name?

Started by Tom Laneabout 17 years ago8 messages
#1Tom Lane
tgl@sss.pgh.pa.us

I'm looking at the window-functions patch and wondering just what kind
of trouble we'll get into if we leave its new plan node type named just
"Window". I've already confirmed that this is a direct conflict against
a typedef in <X11/X.h>, and I'd be not the least bit surprised if it's
used in even-more-popular system headers on Windows or Darwin. Now
maybe you could always get away with not including such headers together
with plannodes.h, but it sure looks like problems waiting to happen.

So I'm thinking we'd better rename it, but I'm not coming up with
anything good; the best I can do after a long day is "EvalWindow",
and that doesn't seem particularly inspired. Any suggestions?

regards, tom lane

#2David Fetter
david@fetter.org
In reply to: Tom Lane (#1)
Re: Is "Window" really safe as a global typedef name?

On Fri, Dec 19, 2008 at 10:36:30PM -0500, Tom Lane wrote:

I'm looking at the window-functions patch and wondering just what
kind of trouble we'll get into if we leave its new plan node type
named just "Window". I've already confirmed that this is a direct
conflict against a typedef in <X11/X.h>, and I'd be not the least
bit surprised if it's used in even-more-popular system headers on
Windows or Darwin. Now maybe you could always get away with not
including such headers together with plannodes.h, but it sure looks
like problems waiting to happen.

So I'm thinking we'd better rename it, but I'm not coming up with
anything good; the best I can do after a long day is "EvalWindow",
and that doesn't seem particularly inspired. Any suggestions?

QueryWindow? ResultSetWindow?

Cheers,
David.
--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david.fetter@gmail.com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

#3Heikki Linnakangas
heikki.linnakangas@enterprisedb.com
In reply to: Tom Lane (#1)
Re: Is "Window" really safe as a global typedef name?

Tom Lane wrote:

I'm looking at the window-functions patch and wondering just what kind
of trouble we'll get into if we leave its new plan node type named just
"Window". I've already confirmed that this is a direct conflict against
a typedef in <X11/X.h>, and I'd be not the least bit surprised if it's
used in even-more-popular system headers on Windows or Darwin. Now
maybe you could always get away with not including such headers together
with plannodes.h, but it sure looks like problems waiting to happen.

So I'm thinking we'd better rename it, but I'm not coming up with
anything good; the best I can do after a long day is "EvalWindow",
and that doesn't seem particularly inspired. Any suggestions?

EvalWindow sounds like a function in src/backend/executor/.

WindowAgg?

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

#4Greg Stark
greg.stark@enterprisedb.com
In reply to: Heikki Linnakangas (#3)
Re: Is "Window" really safe as a global typedef name?

OLAPWindow? Gives a clue what meaning of "window" it's referring to...

--
Greg

On 20 Dec 2008, at 03:13, Heikki Linnakangas <heikki.linnakangas@enterprisedb.com

Show quoted text

wrote:

Tom Lane wrote:

I'm looking at the window-functions patch and wondering just what
kind
of trouble we'll get into if we leave its new plan node type named
just
"Window". I've already confirmed that this is a direct conflict
against
a typedef in <X11/X.h>, and I'd be not the least bit surprised if
it's
used in even-more-popular system headers on Windows or Darwin. Now
maybe you could always get away with not including such headers
together
with plannodes.h, but it sure looks like problems waiting to happen.
So I'm thinking we'd better rename it, but I'm not coming up with
anything good; the best I can do after a long day is "EvalWindow",
and that doesn't seem particularly inspired. Any suggestions?

EvalWindow sounds like a function in src/backend/executor/.

WindowAgg?

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: Heikki Linnakangas (#3)
Re: Is "Window" really safe as a global typedef name?

Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:

Tom Lane wrote:

So I'm thinking we'd better rename it, but I'm not coming up with
anything good; the best I can do after a long day is "EvalWindow",
and that doesn't seem particularly inspired. Any suggestions?

EvalWindow sounds like a function in src/backend/executor/.

WindowAgg?

WindowAgg seems like a winner to me, because it draws a parallel to
the regular Agg node type, which seems valid unless I've completely
misunderstood what's happening...

regards, tom lane

#6Hitoshi Harada
umi.tanuki@gmail.com
In reply to: Tom Lane (#5)
Re: Is "Window" really safe as a global typedef name?

2008/12/21 Tom Lane <tgl@sss.pgh.pa.us>:

Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:

Tom Lane wrote:

So I'm thinking we'd better rename it, but I'm not coming up with
anything good; the best I can do after a long day is "EvalWindow",
and that doesn't seem particularly inspired. Any suggestions?

EvalWindow sounds like a function in src/backend/executor/.

WindowAgg?

WindowAgg seems like a winner to me, because it draws a parallel to
the regular Agg node type, which seems valid unless I've completely
misunderstood what's happening...

I disagree with WindowAgg. The aggregates are subset of window
functions in the node, though much code is similar and ported from
nodeAgg.

The spec introduces its concept as "Windowed Table". So I'd suggest
"WindowedTable" or "WindowTable". Or "Windowed" if shortened.

Regards,

--
Hitoshi Harada

#7Tom Lane
tgl@sss.pgh.pa.us
In reply to: Hitoshi Harada (#6)
Re: Is "Window" really safe as a global typedef name?

"Hitoshi Harada" <umi.tanuki@gmail.com> writes:

2008/12/21 Tom Lane <tgl@sss.pgh.pa.us>:

Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:

WindowAgg?

WindowAgg seems like a winner to me, because it draws a parallel to
the regular Agg node type, which seems valid unless I've completely
misunderstood what's happening...

I disagree with WindowAgg. The aggregates are subset of window
functions in the node, though much code is similar and ported from
nodeAgg.

So? If Agg does a subset of what WindowAgg does, all the more reason
to use that name.

The spec introduces its concept as "Windowed Table". So I'd suggest
"WindowedTable" or "WindowTable". Or "Windowed" if shortened.

I don't care for this proposal. Most of the plan node types are named
after verbs denoting their actions ("scan", "sort", etc --- note that
"aggregate" can be a verb in English, and I think the verb sense is what
the Agg(regate) node is named for). Choosing a name that's a noun
doesn't fit in.

regards, tom lane

#8Hitoshi Harada
umi.tanuki@gmail.com
In reply to: Tom Lane (#7)
Re: Is "Window" really safe as a global typedef name?

2008/12/22 Tom Lane <tgl@sss.pgh.pa.us>:

"Hitoshi Harada" <umi.tanuki@gmail.com> writes:

2008/12/21 Tom Lane <tgl@sss.pgh.pa.us>:

Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:

WindowAgg?

WindowAgg seems like a winner to me, because it draws a parallel to
the regular Agg node type, which seems valid unless I've completely
misunderstood what's happening...

I disagree with WindowAgg. The aggregates are subset of window
functions in the node, though much code is similar and ported from
nodeAgg.

So? If Agg does a subset of what WindowAgg does, all the more reason
to use that name.

OK. I thought WindowAgg means some kind of subset of Agg, but if it
means Window (And) Agg then it makes sense to me.

Regards,

--
Hitoshi Harada