BUG #5123: bug in window function "last_value"

From: "Andrey" <andrey(at)ulab(dot)ru>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #5123: bug in window function "last_value"
Date: 2009-10-16 07:54:39
Message-ID: 200910160754.n9G7sdYx010385@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 5123
Logged by: Andrey
Email address: andrey(at)ulab(dot)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 serial NOT NULL,
CONSTRAINT pkey_t PRIMARY KEY (id)
)
WITH (OIDS=FALSE);

INSERT INTO t VALUES(default);
INSERT INTO t VALUES(default);
INSERT INTO t VALUES(default);

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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Dave Page 2009-10-16 09:13:46 Re: Re: BUG #5065: pg_ctl start fails as administrator, with "could not locate matching postgres executable"
Previous Message Muris Pucic 2009-10-16 07:26:14 BUG #5122: Subqueries - inner select statement bug