Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-bugs by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group