Re: WIP Patch for GROUPING SETS phase 1 - Mailing list pgsql-hackers

From Andrew Gierth
Subject Re: WIP Patch for GROUPING SETS phase 1
Date
Msg-id 874mx5rim4.fsf@news-spur.riddles.org.uk
Whole thread Raw
In response to Re: WIP Patch for GROUPING SETS phase 1  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: WIP Patch for GROUPING SETS phase 1
Re: WIP Patch for GROUPING SETS phase 1
List pgsql-hackers
>>>>> "Tom" == Tom Lane <tgl@sss.pgh.pa.us> writes:
>> I agree, the contrib/cube patch as posted is purely so we could test>> everything without having to argue over the
newname first.
 
Tom> I wonder if you've tried hard enough to avoid reserving the keyword.

GROUP BY cube(a,b)  is currently legal syntax and means something completely
incompatible to what the spec requires.

GROUP BY GROUPING SETS (cube(a,b), c)  -- is that cube(a,b) an expression
to group on, or a list of grouping sets to expand?

GROUP BY (cube(a,b)) -- should that be an error, or silently treat it
as a function call rather than a grouping set? What about GROUP BY
GROUPING SETS ((cube(a,b)) ? (both are errors in our patch)

Accepting those as valid implies a degree of possible confusion that I
personally regard as quite questionable.  Previous discussion seemed to
have accepted that contrib/cube was going to have to be renamed.
Tom> I think that the cube extension is not going to be the onlyTom> casualty if "cube" becomes a reserved word ---
thatseems like aTom> name that could be in use in lots of applications.  ("What doTom> you mean, 9.5 breaks our
databasefor tracking office space?")Tom> It would be worth quite a bit of effort to avoid that.
 

It has been a reserved word in the spec since, what, 1999? and it is a
reserved word in mssql, oracle, db2, etc.?

It only needs to be a col_name_keyword, so it still works as a table
or column name (as usual we are less strict than the spec in that
respect).  I'm looking into whether it can be made unreserved, but I
have serious doubts about this being a good idea.

-- 
Andrew (irc:RhodiumToad)



pgsql-hackers by date:

Previous
From: "Baker, Keith [OCDUS Non-J&J]"
Date:
Subject: Re: Proposal to add a QNX 6.5 port to PostgreSQL
Next
From: Pavel Stehule
Date:
Subject: Re: WIP Patch for GROUPING SETS phase 1