Re: BUG #5123: bug in window function "last_value" - Mailing list pgsql-bugs

From David Fetter
Subject Re: BUG #5123: bug in window function "last_value"
Date
Msg-id 20091016162031.GA3999@fetter.org
Whole thread Raw
In response to Re: BUG #5123: bug in window function "last_value"  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Responses Re: BUG #5123: bug in window function "last_value"
List pgsql-bugs
On Fri, Oct 16, 2009 at 04:45:55PM +0300, Heikki Linnakangas wrote:
> Andrey wrote:
> > select id, first_value(id) over(order by id), last_value(id) over(order by
> > id) from t;
> >
> > RESULT:
> >  id | first_value | last_value
> > ----+-------------+------------
> >   1 |           1 |          1
> >   2 |           1 |          2
> >   3 |           1 |          3
> > (3 rows)
> >
> > fist_value - good, last_value - bad
>
> Looks ok to me. What did you expect?

I think what the OP was expecting was to have the last value be 3
instead of changing.  This is at least a POLA violation.

Cheers,
David.
--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david.fetter@gmail.com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #5121: Segmentation Fault when using pam w/ krb5
Next
From: Tom Lane
Date:
Subject: Re: BUG #5121: Segmentation Fault when using pam w/ krb5