Re: [GENERAL] SQL:2003 Window Functions for postgresql 8.3?

2006-08-25 Thread Gregory Stark
Tom Lane [EMAIL PROTECTED] writes: Martijn van Oosterhout kleptog@svana.org writes: The main thing I want to use them for is for cumulative output. ... With window functions you define for each row a window which is from the beginning of the table to that row and then sum the values, for

Re: [GENERAL] SQL:2003 Window Functions for postgresql 8.3?

2006-08-25 Thread Karen Hill
Alvaro Herrera wrote: Karen Hill wrote: It would be really great if PostgreSQL supported SQL:2003 Window functions. I know that oracle and sql server have them already, so it would make postgres competitive in that area. I know there is a feature freeze for 8.2, is it doable for 8.3?

Re: [GENERAL] SQL:2003 Window Functions for postgresql 8.3?

2006-08-25 Thread Bruce Momjian
Karen Hill wrote: Alvaro Herrera wrote: Karen Hill wrote: It would be really great if PostgreSQL supported SQL:2003 Window functions. I know that oracle and sql server have them already, so it would make postgres competitive in that area. I know there is a feature freeze for

Re: [GENERAL] SQL:2003 Window Functions for postgresql 8.3?

2006-08-25 Thread Alvaro Herrera
Bruce Momjian wrote: Karen Hill wrote: Alvaro Herrera wrote: Karen Hill wrote: It would be really great if PostgreSQL supported SQL:2003 Window functions. I know that oracle and sql server have them already, so it would make postgres competitive in that area. I know there

Re: [GENERAL] SQL:2003 Window Functions for postgresql 8.3?

2006-08-25 Thread Bruce Momjian
Alvaro Herrera wrote: Bruce Momjian wrote: Karen Hill wrote: Alvaro Herrera wrote: Karen Hill wrote: It would be really great if PostgreSQL supported SQL:2003 Window functions. I know that oracle and sql server have them already, so it would make postgres

Re: [GENERAL] SQL:2003 Window Functions for postgresql 8.3?

2006-08-25 Thread Alvaro Herrera
Bruce Momjian wrote: Alvaro Herrera wrote: Bruce Momjian wrote: Karen Hill wrote: Alvaro Herrera wrote: Karen Hill wrote: It would be really great if PostgreSQL supported SQL:2003 Window functions. I know that oracle and sql server have them already, so

Re: [GENERAL] SQL:2003 Window Functions for postgresql 8.3?

2006-08-25 Thread Joshua D. Drake
I looked at the TODO list at http://www.postgresql.org/docs/faqs.TODO.html, and I don't see SQL:2003 Window Functions listed. Is it because they are not desired, or is it because there are more pressing things to accomplish? I noticed that Tom has mentioned that it appears unworkable in this

Re: [GENERAL] SQL:2003 Window Functions for postgresql 8.3?

2006-08-25 Thread Bruce Momjian
Alvaro Herrera wrote: They are in the standard and have been mentioned many times. Mentioned how? Window functions? I have seem people ask for them in the past week, but never before that. Yeah, window functions. I remember Chris Kings-Lynne mentioning them since at least a year

[GENERAL] SQL:2003 Window Functions for postgresql 8.3?

2006-08-24 Thread Karen Hill
I know that in pgsql.hackers they are discussing what to market the upcoming 8.2 release as. They mention updatable views, but realistically, PostgreSQL has had them via rules forever. I consider myself a database novice , and even I've created updatable views using rules quite easily. It

Re: [GENERAL] SQL:2003 Window Functions for postgresql 8.3?

2006-08-24 Thread Alvaro Herrera
Karen Hill wrote: It would be really great if PostgreSQL supported SQL:2003 Window functions. I know that oracle and sql server have them already, so it would make postgres competitive in that area. I know there is a feature freeze for 8.2, is it doable for 8.3? The sooner you start

Re: [GENERAL] SQL:2003 Window Functions for postgresql 8.3?

2006-08-24 Thread AgentM
On Aug 24, 2006, at 14:11 , Alvaro Herrera wrote: Karen Hill wrote: It would be really great if PostgreSQL supported SQL:2003 Window functions. I know that oracle and sql server have them already, so it would make postgres competitive in that area. I know there is a feature freeze for

Re: [GENERAL] SQL:2003 Window Functions for postgresql 8.3?

2006-08-24 Thread Dann Corbit
-Original Message- From: [EMAIL PROTECTED] [mailto:pgsql-general- [EMAIL PROTECTED] On Behalf Of AgentM Sent: Thursday, August 24, 2006 11:27 AM To: PostgreSQL General ML Subject: Re: [GENERAL] SQL:2003 Window Functions for postgresql 8.3? On Aug 24, 2006, at 14:11 , Alvaro

Re: [GENERAL] SQL:2003 Window Functions for postgresql 8.3?

2006-08-24 Thread Martijn van Oosterhout
On Thu, Aug 24, 2006 at 02:26:53PM -0400, AgentM wrote: Could someone elaborate on the window functions? This page http:// en.wikipedia.org/wiki/SELECT has some examples but they make it seem like the functions are an overly-verbose LIMIT statement. So what's the benefit? Look for more

Re: [GENERAL] SQL:2003 Window Functions for postgresql 8.3?

2006-08-24 Thread Tom Lane
Martijn van Oosterhout kleptog@svana.org writes: The main thing I want to use them for is for cumulative output. ... With window functions you define for each row a window which is from the beginning of the table to that row and then sum the values, for each row. Then you just divide by the

Re: [GENERAL] SQL:2003 Window Functions for postgresql 8.3?

2006-08-24 Thread Ben
Postgres' DISTINCT ON clause is an example of a window function, though as it stands today it seems to be a special-case hack, instead of an example of a more generalized feature. On Thu, 24 Aug 2006, AgentM wrote: On Aug 24, 2006, at 14:11 , Alvaro Herrera wrote: Karen Hill wrote: It

Re: [GENERAL] SQL:2003 Window Functions for postgresql 8.3?

2006-08-24 Thread Martijn van Oosterhout
On Thu, Aug 24, 2006 at 02:47:20PM -0400, Tom Lane wrote: Martijn van Oosterhout kleptog@svana.org writes: The main thing I want to use them for is for cumulative output. ... With window functions you define for each row a window which is from the beginning of the table to that row and

Re: [GENERAL] SQL:2003 Window Functions for postgresql 8.3?

2006-08-24 Thread Thomas Kellerer
Tom Lane wrote on 24.08.2006 20:47: Perhaps an extremely smart optimizer could improve this using knowledge of the specific aggregates' behaviors, but for black box aggregates it sounds pretty unworkable. I don't know how they do it, but those functions in Oracle are pretty fast. Usually ways

Re: [GENERAL] SQL:2003 Window Functions for postgresql 8.3?

2006-08-24 Thread Christopher Browne
Clinging to sanity, [EMAIL PROTECTED] (Tom Lane) mumbled into her beard: Martijn van Oosterhout kleptog@svana.org writes: The main thing I want to use them for is for cumulative output. ... With window functions you define for each row a window which is from the beginning of the table to that