| From: | David Fetter <david(at)fetter(dot)org> |
|---|---|
| To: | Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com> |
| Cc: | Andrey <andrey(at)ulab(dot)ru>, pgsql-bugs(at)postgresql(dot)org |
| Subject: | Re: BUG #5123: bug in window function "last_value" |
| Date: | 2009-10-16 16:20:31 |
| Message-ID: | 20091016162031.GA3999@fetter.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | 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(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com
Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2009-10-16 16:37:20 | Re: BUG #5121: Segmentation Fault when using pam w/ krb5 |
| Previous Message | Douglas, Ryan | 2009-10-16 16:19:51 | Re: BUG #5121: Segmentation Fault when using pam w/ krb5 |