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: [HACKERS] Department of Redundancy Department: makeNode(FuncCall) division

2013-07-01 Thread Jeevan Chalke
On Mon, Jul 1, 2013 at 6:16 AM, David Fetter da...@fetter.org wrote: On Fri, Jun 28, 2013 at 01:28:35PM -0400, Peter Eisentraut wrote: On 6/28/13 11:30 AM, Robert Haas wrote: On Fri, Jun 28, 2013 at 10:31 AM, Tom Lane t...@sss.pgh.pa.us wrote: David Fetter da...@fetter.org writes:

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: [HACKERS] Department of Redundancy Department: makeNode(FuncCall) division

2013-07-01 Thread Robert Haas
On Mon, Jul 1, 2013 at 3:19 AM, Jeevan Chalke jeevan.cha...@enterprisedb.com wrote: I have re-validated this new patch and it looks good to go in now. I saw that it's already marked ready for committer. I don't normally like to commit things over another committer's objections, but this has +1

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: [HACKERS] Department of Redundancy Department: makeNode(FuncCall) division

2013-06-30 Thread David Fetter
On Fri, Jun 28, 2013 at 01:28:35PM -0400, Peter Eisentraut wrote: On 6/28/13 11:30 AM, Robert Haas wrote: On Fri, Jun 28, 2013 at 10:31 AM, Tom Lane t...@sss.pgh.pa.us wrote: David Fetter da...@fetter.org writes: Please find attached the latest patch. I remain of the opinion that this

Re: [HACKERS] Department of Redundancy Department: makeNode(FuncCall) division

2013-06-28 Thread David Fetter
On Tue, Jun 25, 2013 at 02:54:55PM +0530, Jeevan Chalke wrote: On Tue, Jun 25, 2013 at 11:11 AM, Jeevan Chalke jeevan.cha...@enterprisedb.com wrote: Hi David, I hope this is the latest patch to review, right ? I am going to review it. I have gone through the discussion on this

Re: [HACKERS] Department of Redundancy Department: makeNode(FuncCall) division

2013-06-28 Thread Tom Lane
David Fetter da...@fetter.org writes: Please find attached the latest patch. I remain of the opinion that this is simply a bad idea. It is unlike our habits for constructing other types of nodes, and makes it harder not easier to find all the places that need to be updated when adding another

Re: [HACKERS] Department of Redundancy Department: makeNode(FuncCall) division

2013-06-28 Thread David Fetter
On Fri, Jun 28, 2013 at 10:31:16AM -0400, Tom Lane wrote: David Fetter da...@fetter.org writes: Please find attached the latest patch. I remain of the opinion that this is simply a bad idea. It is unlike our habits for constructing other types of nodes, and makes it harder not easier to

Re: [HACKERS] Department of Redundancy Department: makeNode(FuncCall) division

2013-06-28 Thread Robert Haas
On Fri, Jun 28, 2013 at 10:31 AM, Tom Lane t...@sss.pgh.pa.us wrote: David Fetter da...@fetter.org writes: Please find attached the latest patch. I remain of the opinion that this is simply a bad idea. It is unlike our habits for constructing other types of nodes, and makes it harder not

Re: [HACKERS] Department of Redundancy Department: makeNode(FuncCall) division

2013-06-28 Thread Peter Eisentraut
On 6/28/13 11:30 AM, Robert Haas wrote: On Fri, Jun 28, 2013 at 10:31 AM, Tom Lane t...@sss.pgh.pa.us wrote: David Fetter da...@fetter.org writes: Please find attached the latest patch. I remain of the opinion that this is simply a bad idea. It is unlike our habits for constructing other

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: [HACKERS] Department of Redundancy Department: makeNode(FuncCall) division

2013-06-25 Thread Jeevan Chalke
On Tue, Jun 25, 2013 at 11:11 AM, Jeevan Chalke jeevan.cha...@enterprisedb.com wrote: Hi David, I hope this is the latest patch to review, right ? I am going to review it. I have gone through the discussion on this thread and I agree with Stephen Frost that it don't add much improvements

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: [HACKERS] Department of Redundancy Department: makeNode(FuncCall) division

2013-06-24 Thread Jeevan Chalke
Hi David, I hope this is the latest patch to review, right ? I am going to review it. I have gone through the discussion on this thread and I agree with Stephen Frost that it don't add much improvements as such but definitely it is going to be easy for contributors in this area as they don't

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: [HACKERS] Department of Redundancy Department: makeNode(FuncCall) division

2013-06-17 Thread Stephen Frost
* David Fetter (da...@fetter.org) wrote: On Mon, Feb 11, 2013 at 10:48:38AM -0800, David Fetter wrote: On Sun, Feb 10, 2013 at 10:09:19AM -0500, Tom Lane wrote: David Fetter da...@fetter.org writes: 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-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: [HACKERS] Department of Redundancy Department: makeNode(FuncCall) division

2013-06-16 Thread David Fetter
On Mon, Feb 11, 2013 at 10:48:38AM -0800, David Fetter wrote: On Sun, Feb 10, 2013 at 10:09:19AM -0500, Tom Lane wrote: David Fetter da...@fetter.org writes: Per suggestions and lots of help from Andrew Gierth, please find attached a patch to clean up the call sites for FuncCall nodes,

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

Re: [HACKERS] Department of Redundancy Department: makeNode(FuncCall) division

2013-02-11 Thread David Fetter
On Sun, Feb 10, 2013 at 10:09:19AM -0500, Tom Lane wrote: David Fetter da...@fetter.org writes: 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 centrally rather than in each of the 37

Re: [HACKERS] Department of Redundancy Department: makeNode(FuncCall) division

2013-02-10 Thread Tom Lane
David Fetter da...@fetter.org writes: 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 centrally rather than in each of the 37 (or 38, but I only redid 37) places where it's called. The

Re: [HACKERS] Department of Redundancy Department: makeNode(FuncCall) division

2013-02-10 Thread David Fetter
On Sun, Feb 10, 2013 at 10:09:19AM -0500, Tom Lane wrote: David Fetter da...@fetter.org writes: 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 centrally rather than in each of the 37

[HACKERS] Department of Redundancy Department: makeNode(FuncCall) division

2013-02-09 Thread David Fetter
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 centrally rather than in each of the 37 (or 38, but I only redid 37) places where it's called. The remaining one is in