Re: [BUGS] BUG #5123: bug in window function "last_value"

2009-10-16 Thread David Fetter
On Fri, Oct 16, 2009 at 01:28:57PM -0400, Tom Lane wrote: > David Fetter writes: > > 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. > > [ shrug... ] It's what the spec requires, as far as anybody here > can tell. As

Re: [BUGS] BUG #5123: bug in window function "last_value"

2009-10-16 Thread Tom Lane
David Fetter writes: > 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. [ shrug... ] It's what the spec requires, as far as anybody here can tell. As Hitoshi-san already noted, we do point out in our docs that last_valu

Re: [BUGS] BUG #5123: bug in window function "last_value"

2009-10-16 Thread David Fetter
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 |

Re: [BUGS] BUG #5123: bug in window function "last_value"

2009-10-16 Thread Hitoshi Harada
2009/10/16 Tom Lane : > Heikki Linnakangas writes: >> 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 |        

Re: [BUGS] BUG #5123: bug in window function "last_value"

2009-10-16 Thread Tom Lane
Heikki Linnakangas writes: > 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 |

Re: [BUGS] BUG #5123: bug in window function "last_value"

2009-10-16 Thread Heikki Linnakangas
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) > >

[BUGS] BUG #5123: bug in window function "last_value"

2009-10-16 Thread Andrey
The following bug has been logged online: Bug reference: 5123 Logged by: Andrey Email address: and...@ulab.ru PostgreSQL version: 8.4.1-x86_64 Operating system: RHEL5-x86_64 Description:bug in window function "last_value" Details: EXAMPLE: CREATE TABLE t ( id ser