#29850: Add window support for RowRange frames
-------------------------------------+-------------------------------------
     Reporter:  Daniel Fuchs         |                    Owner:  felixxm
         Type:  New feature          |                   Status:  assigned
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Old description:

> The current RowRange frame is missing handling for several cases.
>
> None of the following are currently supported:
> RowRange(start=-2, end=-1)
> ROWS BETWEEN 2 PRECEDING AND 1 PRECEDING
> RowRange(start=1, end=2)
> ROWS BETWEEN 1 FOLLOWING AND 2 FOLLOWING
>
> It's also missing support for EXCLUDE.
> ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING EXCLUDE CURRENT ROW
>
> ----
>
> Frame exclusion is supported only in [https://www.postgresql.org/docs/11
> /sql-expressions.html#SYNTAX-WINDOW-FUNCTIONS PostgreSQL 11+], other
> databases do not support exclusion (see
> [https://docs.oracle.com/en/database/oracle/oracle-database/18/sqlrf
> /Analytic-Functions.html#GUID-527832F7-63C0-4445-8C16-307FA5084056 Oracle
> 18c doc], [https://mariadb.com/kb/en/library/window-functions-overview/
> MariaDB doc], and [https://dev.mysql.com/doc/refman/8.0/en/window-
> functions-frames.html MySQL doc]).

New description:

 The current RowRange frame is missing handling for several cases.

 None of the following are currently supported:
 RowRange(start=-2, end=-1)
 ROWS BETWEEN 2 PRECEDING AND 1 PRECEDING
 RowRange(start=1, end=2)
 ROWS BETWEEN 1 FOLLOWING AND 2 FOLLOWING

 It's also missing support for EXCLUDE.
 ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING EXCLUDE CURRENT ROW

 ----

 Frame exclusion is supported only in [https://www.postgresql.org/docs/11
 /sql-expressions.html#SYNTAX-WINDOW-FUNCTIONS PostgreSQL 11+] and
 [https://www.sqlite.org/windowfunctions.html#wexcls SQLite 3.28+], other
 databases do not support exclusion (see
 [https://docs.oracle.com/en/database/oracle/oracle-database/18/sqlrf
 /Analytic-Functions.html#GUID-527832F7-63C0-4445-8C16-307FA5084056 Oracle
 18c doc], [https://mariadb.com/kb/en/library/window-functions-overview/
 MariaDB doc], and [https://dev.mysql.com/doc/refman/8.0/en/window-
 functions-frames.html MySQL doc]).

--

Comment (by felixxm):

 Exclusion is supported also on SQLite 3.28+ (see
 [https://www.sqlite.org/changes.html#version_3_28_0 release notes]).

-- 
Ticket URL: <https://code.djangoproject.com/ticket/29850#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.0deb17eae38be014bf4793ca07a54b8d%40djangoproject.com.

Reply via email to