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 da...@fetter.org 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

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 da...@fetter.org 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

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 da...@fetter.org wrote: On Fri, Jun 28, 2013 at 09:22:52PM +0100, Dean Rasheed wrote: On 21 June 2013 06:16, David Fetter da...@fetter.org wrote: Please find attached a patch which allows

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 da...@fetter.org wrote: On Fri, Jun 28, 2013 at 09:22:52PM +0100, Dean Rasheed wrote: On 21 June 2013 06:16, David Fetter da...@fetter.org wrote: Please find attached a patch which allows subqueries in the FILTER clause and adds regression testing for same.

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 da...@fetter.org 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

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 da...@fetter.org 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

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 Dean Rasheed
On 26 June 2013 01:01, Josh Berkus j...@agliodbs.com 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,

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 dean.a.rash...@gmail.com: On 26 June 2013 01:01, Josh Berkus j...@agliodbs.com 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

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 t...@sss.pgh.pa.us wrote: David Fetter da...@fetter.org 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

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

2013-06-25 Thread Tom Lane
Dean Rasheed dean.a.rash...@gmail.com writes: On 24 June 2013 03:50, Tom Lane t...@sss.pgh.pa.us 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

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 t...@sss.pgh.pa.us: Dean Rasheed dean.a.rash...@gmail.com writes: On 24 June 2013 03:50, Tom Lane t...@sss.pgh.pa.us 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.

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 t...@sss.pgh.pa.us wrote: David Fetter da...@fetter.org 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

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

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 dean.a.rash...@gmail.com wrote: On 21 June 2013 06:16, David Fetter da...@fetter.org 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

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

2013-06-23 Thread Kevin Grittner
Dean Rasheed dean.a.rash...@gmail.com 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

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 dean.a.rash...@gmail.com 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

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

2013-06-23 Thread Tom Lane
David Fetter da...@fetter.org 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

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 da...@fetter.org 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

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 da...@fetter.org 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),

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 da...@fetter.org 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 it.

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 da...@fetter.org 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

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 filter clause shall not contain a query expression, a window

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: Per the

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: Per the

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 suggestions and lots

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 patch to

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 to expand

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 to expand