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

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Iliya Krapchatov <my_working(at)inbox(dot)ru>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5199: Window frame clause wrong (?) behaviour
Date: 2009-11-19 18:29:27
Message-ID: 4B058E87.7090801@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Iliya Krapchatov wrote:
> 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

Try without the parenthesis in OVER:

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'm quite surprised by the error message that produces, though...

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Jaime Casanova 2009-11-19 19:55:05 Re: data shown from down to up
Previous Message Heikki Linnakangas 2009-11-19 18:19:38 Re: Stored procedure error