Re: FILTER for aggregates [was Re: [HACKERS] Department of Redundancy Department: makeNode(FuncCall) division]

2013-07-07 Thread David Fetter
On Sat, Jul 06, 2013 at 11:49:21AM +0100, Dean Rasheed wrote: > On 5 July 2013 18:23, David Fetter wrote: > > Please find attached changes based on the above. > > > > This looks good. The grammar changes are smaller and neater now on top > of the makeFuncCall() patch. > > Overall I think this pa

Re: FILTER for aggregates [was Re: [HACKERS] Department of Redundancy Department: makeNode(FuncCall) division]

2013-07-06 Thread Dean Rasheed
On 5 July 2013 18:23, David Fetter wrote: > Please find attached changes based on the above. > This looks good. The grammar changes are smaller and neater now on top of the makeFuncCall() patch. Overall I think this patch offers useful additional functionality, in compliance with the SQL spec, w

Re: FILTER for aggregates [was Re: [HACKERS] Department of Redundancy Department: makeNode(FuncCall) division]

2013-07-05 Thread David Fetter
On Mon, Jul 01, 2013 at 05:30:38PM +0100, Dean Rasheed wrote: > On 1 July 2013 01:44, David Fetter wrote: > > On Fri, Jun 28, 2013 at 09:22:52PM +0100, Dean Rasheed wrote: > >> On 21 June 2013 06:16, David Fetter wrote: > >> > Please find attached a patch which allows subqueries in the FILTER > >

Re: FILTER for aggregates [was Re: [HACKERS] Department of Redundancy Department: makeNode(FuncCall) division]

2013-07-01 Thread Dean Rasheed
On 1 July 2013 01:44, David Fetter wrote: > On Fri, Jun 28, 2013 at 09:22:52PM +0100, Dean Rasheed wrote: >> On 21 June 2013 06:16, David Fetter wrote: >> > Please find attached a patch which allows subqueries in the FILTER >> > clause and adds regression testing for same. >> > >> >> This needs r

Re: FILTER for aggregates [was Re: [HACKERS] Department of Redundancy Department: makeNode(FuncCall) division]

2013-06-30 Thread David Fetter
On Fri, Jun 28, 2013 at 09:22:52PM +0100, Dean Rasheed wrote: > On 21 June 2013 06:16, David Fetter wrote: > > Please find attached a patch which allows subqueries in the FILTER > > clause and adds regression testing for same. > > > > This needs re-basing/merging following Robert's recent commit

Re: FILTER for aggregates [was Re: [HACKERS] Department of Redundancy Department: makeNode(FuncCall) division]

2013-06-28 Thread Dean Rasheed
On 21 June 2013 06:16, David Fetter wrote: > Please find attached a patch which allows subqueries in the FILTER > clause and adds regression testing for same. > This needs re-basing/merging following Robert's recent commit to make OVER unreserved. Regards, Dean -- Sent via pgsql-hackers maili

Re: FILTER for aggregates [was Re: [HACKERS] Department of Redundancy Department: makeNode(FuncCall) division]

2013-06-27 Thread Peter Eisentraut
On 6/23/13 10:50 PM, Tom Lane wrote: > It'd sure be interesting to know what the SQL committee's target parsing > algorithm is. It's whatever Oracle and IBM implement. > Or maybe they really don't give a damn about breaking > applications every time they invent a new reserved word? Well, yes, I

Re: FILTER for aggregates [was Re: [HACKERS] Department of Redundancy Department: makeNode(FuncCall) division]

2013-06-26 Thread Pavel Stehule
2013/6/26 Dean Rasheed : > On 26 June 2013 01:01, Josh Berkus wrote: >> >>> I know it's heresy in these parts, but maybe we should consider >>> adopting a non-spec syntax for this feature? In particular, it's >>> really un-obvious why the FILTER clause shouldn't be inside rather >>> than outside

Re: FILTER for aggregates [was Re: [HACKERS] Department of Redundancy Department: makeNode(FuncCall) division]

2013-06-26 Thread Dean Rasheed
On 26 June 2013 01:01, Josh Berkus wrote: > >> I know it's heresy in these parts, but maybe we should consider >> adopting a non-spec syntax for this feature? In particular, it's >> really un-obvious why the FILTER clause shouldn't be inside rather >> than outside the aggregate's parens, like ORD

Re: FILTER for aggregates [was Re: [HACKERS] Department of Redundancy Department: makeNode(FuncCall) division]

2013-06-25 Thread Josh Berkus
> I know it's heresy in these parts, but maybe we should consider > adopting a non-spec syntax for this feature? In particular, it's > really un-obvious why the FILTER clause shouldn't be inside rather > than outside the aggregate's parens, like ORDER BY. Well, what other DBMSes support this fea

Re: FILTER for aggregates [was Re: [HACKERS] Department of Redundancy Department: makeNode(FuncCall) division]

2013-06-25 Thread Robert Haas
On Sun, Jun 23, 2013 at 10:50 PM, Tom Lane wrote: > David Fetter writes: >> On Sun, Jun 23, 2013 at 07:44:26AM -0700, Kevin Grittner wrote: >>> I think it is OK if that gets a syntax error. If that's the "worst >>> case" I like this approach. > >> I think reducing the usefulness of error message

Re: FILTER for aggregates [was Re: [HACKERS] Department of Redundancy Department: makeNode(FuncCall) division]

2013-06-25 Thread Pavel Stehule
2013/6/25 Tom Lane : > Dean Rasheed writes: >> On 24 June 2013 03:50, Tom Lane wrote: >>> Going on the same principle, we could probably let FILTER be an >>> unreserved keyword while FILTER_FOLLOWED_BY_PAREN could be a >>> type_func_name_keyword. (I've not tried this though.) > >> I've not tried

Re: FILTER for aggregates [was Re: [HACKERS] Department of Redundancy Department: makeNode(FuncCall) division]

2013-06-25 Thread Tom Lane
Dean Rasheed writes: > On 24 June 2013 03:50, Tom Lane wrote: >> Going on the same principle, we could probably let FILTER be an >> unreserved keyword while FILTER_FOLLOWED_BY_PAREN could be a >> type_func_name_keyword. (I've not tried this though.) > I've not tried either, but wouldn't that me

Re: FILTER for aggregates [was Re: [HACKERS] Department of Redundancy Department: makeNode(FuncCall) division]

2013-06-25 Thread Dean Rasheed
On 24 June 2013 03:50, Tom Lane wrote: > David Fetter writes: >> On Sun, Jun 23, 2013 at 07:44:26AM -0700, Kevin Grittner wrote: >>> I think it is OK if that gets a syntax error. If that's the "worst >>> case" I like this approach. > >> I think reducing the usefulness of error messages is someth

Re: FILTER for aggregates [was Re: [HACKERS] Department of Redundancy Department: makeNode(FuncCall) division]

2013-06-23 Thread Tom Lane
David Fetter writes: > On Sun, Jun 23, 2013 at 07:44:26AM -0700, Kevin Grittner wrote: >> I think it is OK if that gets a syntax error.  If that's the "worst >> case" I like this approach. > I think reducing the usefulness of error messages is something we need > to think extremely hard about bef

Re: FILTER for aggregates [was Re: [HACKERS] Department of Redundancy Department: makeNode(FuncCall) division]

2013-06-23 Thread David Fetter
On Sun, Jun 23, 2013 at 07:44:26AM -0700, Kevin Grittner wrote: > Dean Rasheed wrote: > > > I'm still not happy that this patch is making FILTER a new reserved > > keyword, because I think it is a common enough English word (and an > > obscure enough SQL keyword) that people may well have used it

Re: FILTER for aggregates [was Re: [HACKERS] Department of Redundancy Department: makeNode(FuncCall) division]

2013-06-23 Thread Kevin Grittner
Dean Rasheed wrote: > I'm still not happy that this patch is making FILTER a new reserved > keyword, because I think it is a common enough English word (and an > obscure enough SQL keyword) that people may well have used it for > table names or aliases, and so their code will break. Well, if it

Re: FILTER for aggregates [was Re: [HACKERS] Department of Redundancy Department: makeNode(FuncCall) division]

2013-06-23 Thread Dean Rasheed
On 21 June 2013 10:02, Dean Rasheed wrote: > On 21 June 2013 06:16, David Fetter wrote: >> On Fri, Jun 21, 2013 at 12:10:25AM -0400, Alvaro Herrera wrote: >>> David Fetter escribió: >>> > On Thu, Jun 20, 2013 at 08:59:27PM +0100, Dean Rasheed wrote: >>> >>> > > In my testing of sub-queries in the

Re: FILTER for aggregates [was Re: [HACKERS] Department of Redundancy Department: makeNode(FuncCall) division]

2013-06-21 Thread Dean Rasheed
On 21 June 2013 06:16, David Fetter wrote: > On Fri, Jun 21, 2013 at 12:10:25AM -0400, Alvaro Herrera wrote: >> David Fetter escribió: >> > On Thu, Jun 20, 2013 at 08:59:27PM +0100, Dean Rasheed wrote: >> >> > > In my testing of sub-queries in the FILTER clause (an extension to the >> > > spec), I

Re: FILTER for aggregates [was Re: [HACKERS] Department of Redundancy Department: makeNode(FuncCall) division]

2013-06-21 Thread Dean Rasheed
On 21 June 2013 05:01, David Fetter wrote: > What tests do you think should be there that aren't? > I think I expected to see more tests related to some of the specific code changes, such as CREATE TABLE t AS SELECT * FROM generate_series(1,10) t(x); -- Should fail (filter can't be used for non

Re: FILTER for aggregates [was Re: [HACKERS] Department of Redundancy Department: makeNode(FuncCall) division]

2013-06-20 Thread David Fetter
On Fri, Jun 21, 2013 at 12:10:25AM -0400, Alvaro Herrera wrote: > David Fetter escribió: > > On Thu, Jun 20, 2013 at 08:59:27PM +0100, Dean Rasheed wrote: > > > > In my testing of sub-queries in the FILTER clause (an extension to the > > > spec), I was able to produce the following error: > > > >

Re: FILTER for aggregates [was Re: [HACKERS] Department of Redundancy Department: makeNode(FuncCall) division]

2013-06-20 Thread David Fetter
On Fri, Jun 21, 2013 at 12:10:25AM -0400, Alvaro Herrera wrote: > David Fetter escribió: > > On Thu, Jun 20, 2013 at 08:59:27PM +0100, Dean Rasheed wrote: > > > > In my testing of sub-queries in the FILTER clause (an extension > > > to the spec), I was able to produce the following error: > > > >

Re: FILTER for aggregates [was Re: [HACKERS] Department of Redundancy Department: makeNode(FuncCall) division]

2013-06-20 Thread Alvaro Herrera
David Fetter escribió: > On Thu, Jun 20, 2013 at 08:59:27PM +0100, Dean Rasheed wrote: > > In my testing of sub-queries in the FILTER clause (an extension to the > > spec), I was able to produce the following error: > > Per the spec, > > B) A shall not contain a , a function>, or an outer ref

Re: FILTER for aggregates [was Re: [HACKERS] Department of Redundancy Department: makeNode(FuncCall) division]

2013-06-20 Thread David Fetter
On Thu, Jun 20, 2013 at 08:59:27PM +0100, Dean Rasheed wrote: > On 17 June 2013 06:36, David Fetter wrote: > >> > > Please find attached two versions of a patch which provides optional > >> > > FILTER clause for aggregates (T612, "Advanced OLAP operations"). > >> > > > >> > > The first is intended

Re: FILTER for aggregates [was Re: [HACKERS] Department of Redundancy Department: makeNode(FuncCall) division]

2013-06-20 Thread Dean Rasheed
On 17 June 2013 06:36, David Fetter wrote: >> > > Please find attached two versions of a patch which provides optional >> > > FILTER clause for aggregates (T612, "Advanced OLAP operations"). >> > > >> > > The first is intended to be applied on top of the previous patch, the >> > > second without i

Re: FILTER for aggregates [was Re: [HACKERS] Department of Redundancy Department: makeNode(FuncCall) division]

2013-06-16 Thread David Fetter
On Sun, Apr 28, 2013 at 01:29:41PM -0700, David Fetter wrote: > On Tue, Feb 26, 2013 at 01:09:30PM -0800, David Fetter wrote: > > On Wed, Feb 13, 2013 at 06:45:31AM -0800, David Fetter wrote: > > > On Sat, Feb 09, 2013 at 11:59:22PM -0800, David Fetter wrote: > > > > Folks, > > > > > > > > Per sug

Re: FILTER for aggregates [was Re: [HACKERS] Department of Redundancy Department: makeNode(FuncCall) division]

2013-04-28 Thread David Fetter
On Tue, Feb 26, 2013 at 01:09:30PM -0800, David Fetter wrote: > On Wed, Feb 13, 2013 at 06:45:31AM -0800, David Fetter wrote: > > On Sat, Feb 09, 2013 at 11:59:22PM -0800, David Fetter wrote: > > > Folks, > > > > > > Per suggestions and lots of help from Andrew Gierth, please find > > > attached a

Re: FILTER for aggregates [was Re: [HACKERS] Department of Redundancy Department: makeNode(FuncCall) division]

2013-02-26 Thread David Fetter
On Wed, Feb 13, 2013 at 06:45:31AM -0800, David Fetter wrote: > On Sat, Feb 09, 2013 at 11:59:22PM -0800, David Fetter wrote: > > Folks, > > > > Per suggestions and lots of help from Andrew Gierth, please find > > attached a patch to clean up the call sites for FuncCall nodes, which > > I'd like t

Re: FILTER for aggregates [was Re: [HACKERS] Department of Redundancy Department: makeNode(FuncCall) division]

2013-02-13 Thread David Fetter
On Wed, Feb 13, 2013 at 06:45:31AM -0800, David Fetter wrote: > On Sat, Feb 09, 2013 at 11:59:22PM -0800, David Fetter wrote: > > Folks, > > > > Per suggestions and lots of help from Andrew Gierth, please find > > attached a patch to clean up the call sites for FuncCall nodes, which > > I'd like t