PostgreSQL 9.0 - support for RANGE value PRECEDING window functions

Started by Daniel Scottalmost 16 years ago4 messagesgeneral
Jump to latest
#1Daniel Scott
djscott@mit.edu

Hi,

I have a question about a feature in PostgreSQL 9.0.

I am looking for support for windowing functions when using: RANGE
BETWEEN <value> PRECEDING/FOLLOWING AND <value>
PRECEDING/FOLLOWING

The latest documentation:

http://www.postgresql.org/docs/9.0/static/sql-expressions.html#SYNTAX-WINDOW-FUNCTIONS

Says "The value PRECEDING and value FOLLOWING cases are currently only
allowed in ROWS mode."

However, I have found this post:

http://archives.postgresql.org/message-id/e08cc0400912310149me7150cek3c9aa92e4d396ac3@mail.gmail.com

Which appears to provide a patch supporting: "- allow all of RANGE
BETWEEN <value> PRECEDING/FOLLOWING AND <value>
PRECEDING/FOLLOWING". However, I cannot find any further information
related to this feature.

Can anyone confirm whether or not this feature will be available in
PostgreSQL 9.0?

Thanks,

Dan Scott

#2Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Daniel Scott (#1)
Re: PostgreSQL 9.0 - support for RANGE value PRECEDING window functions

Excerpts from Daniel Scott's message of lun may 10 13:20:06 -0400 2010:

Says "The value PRECEDING and value FOLLOWING cases are currently only
allowed in ROWS mode."

However, I have found this post:

http://archives.postgresql.org/message-id/e08cc0400912310149me7150cek3c9aa92e4d396ac3@mail.gmail.com

Which appears to provide a patch supporting: "- allow all of RANGE
BETWEEN <value> PRECEDING/FOLLOWING AND <value>
PRECEDING/FOLLOWING". However, I cannot find any further information
related to this feature.

It was ripped out of the patch before commit because the implementation was not
acceptable.

Can anyone confirm whether or not this feature will be available in
PostgreSQL 9.0?

No.
--

#3Daniel Scott
djscott@mit.edu
In reply to: Alvaro Herrera (#2)
Re: PostgreSQL 9.0 - support for RANGE value PRECEDING window functions

Hi,

On Mon, May 10, 2010 at 13:35, Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:

It was ripped out of the patch before commit because the implementation was not
acceptable.

That's strange - the CommitFest says that it was committed and I can't
find any mention of it being removed. Is there somewhere I can see a
discussion of this?

https://commitfest.postgresql.org/action/commitfest_view?id=5

Also, the documentation

http://www.postgresql.org/docs/9.0/static/sql-expressions.html#SYNTAX-WINDOW-FUNCTIONS

shows:

[ RANGE | ROWS ] BETWEEN frame_start AND frame_end

Can you point me to the right place for getting this changed to remove
"RANGE". Maybe the developer mailing list?

Thanks,

Dan Scott

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Daniel Scott (#3)
Re: PostgreSQL 9.0 - support for RANGE value PRECEDING window functions

Daniel Scott <djscott@mit.edu> writes:

On Mon, May 10, 2010 at 13:35, Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:

It was ripped out of the patch before commit because the implementation was not
acceptable.

That's strange - the CommitFest says that it was committed and I can't
find any mention of it being removed. Is there somewhere I can see a
discussion of this?

Look into the pgsql-hackers thread about it. (The commitfest notes are
not meant to be a complete record of the mailing list discussions.)
I think the relevant part starts here:
http://archives.postgresql.org/pgsql-hackers/2010-02/msg00540.php

Also, the documentation
http://www.postgresql.org/docs/9.0/static/sql-expressions.html#SYNTAX-WINDOW-FUNCTIONS
shows:
[ RANGE | ROWS ] BETWEEN frame_start AND frame_end
Can you point me to the right place for getting this changed to remove
"RANGE". Maybe the developer mailing list?

There's nothing to remove there, since RANGE is in fact valid with many
of the alternatives for frame_start and frame_end. It would be very
awkward to try to show this limitation as part of the syntax diagram,
so it's just specified in the text.

regards, tom lane