Re: BUG #5199: Window frame clause wrong (?) behaviour - Mailing list pgsql-bugs

From Heikki Linnakangas
Subject Re: BUG #5199: Window frame clause wrong (?) behaviour
Date
Msg-id 4B058E87.7090801@enterprisedb.com
Whole thread Raw
In response to BUG #5199: Window frame clause wrong (?) behaviour  ("Iliya Krapchatov" <my_working@inbox.ru>)
Responses Re: BUG #5199: Window frame clause wrong (?) behaviour  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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

pgsql-bugs by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Stored procedure error
Next
From: "Orange"
Date:
Subject: data shown from down to up