BUG #5199: Window frame clause wrong (?) behaviour

From: "Iliya Krapchatov" <my_working(at)inbox(dot)ru>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #5199: Window frame clause wrong (?) behaviour
Date: 2009-11-19 17:11:51
Message-ID: 200911191711.nAJHBped009004@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 5199
Logged by: Iliya Krapchatov
Email address: my_working(at)inbox(dot)ru
PostgreSQL version: 8.4.1
Operating system: Windows XP
Description: Window frame clause wrong (?) behaviour
Details:

I am new at WINDOW clause using so maybe I've missed something. Following is
the sequence of steps to repeat the problem:

create table t( pk integer );
insert into t(pk) values( 1 );
insert into t(pk) values( 2 );

select first_value( pk ) OVER ( pkw ) FROM t
WINDOW pkw AS ( PARTITION BY pk ORDER BY pk RANGE BETWEEN UNBOUNDED
PRECEDING AND UNBOUNDED FOLLOWING );

I see following lines in response:
---
ERROR: cannot override frame clause of window "pkw"
LINE 1: select first_value( pk ) OVER ( pkw ) FROM t
^

********** Error **********

ERROR: cannot override frame clause of window "pkw"
SQL state: 42P20
Характеристика:31
---

I believe that is a bug because next two queries work fine:

select first_value( pk ) OVER ( PARTITION BY pk ORDER BY pk RANGE BETWEEN
UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t;

select first_value( pk ) OVER ( pkw ) FROM t
WINDOW pkw AS ( PARTITION BY pk ORDER BY pk );

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Orange 2009-11-19 18:03:47 data shown from down to up
Previous Message Tom Lane 2009-11-19 15:13:39 Re: BUG #5198: Plain dump: wrong field order for inherited tables