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

Re: review: More frame options in window functions

From: "Erik Rijkers" <er(at)xs4all(dot)nl>
To: "Hitoshi Harada" <umi(dot)tanuki(at)gmail(dot)com>
Cc: "PostgreSQL-development" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: review: More frame options in window functions
Date: 2010-01-15 23:12:47
Message-ID: 97bab00da41cb11284fec2476cc1d71c.squirrel@webmail.xs4all.nl (view raw or flat)
Thread:
Lists: pgsql-hackers
> Thanks for the review. I've found another crash today and attached is
> fixed version. The case is:
>
> SELECT four, sum(ten) over (PARTITION BY four ORDER BY four RANGE 1
> PRECEDING) FROM tenk1 WHERE unique1 < 10;
>

Hi,

The patch (more_frame_options.20100115.patch.gz) applies cleanly, but the regression test gives:


***
/var/data1/pg_stuff/pg_sandbox/pgsql.rows_frame_types/src/test/regress/expected/window.out	2010-01-15
22:36:01.000000000 +0100
---
/var/data1/pg_stuff/pg_sandbox/pgsql.rows_frame_types/src/test/regress/results/window.out	2010-01-15
22:37:01.000000000 +0100
***************
*** 934,953 ****

  SELECT four, ten, sum(ten) over (partition by four order by four range 1 preceding)
  FROM tenk1 WHERE unique1 < 10;
!  four | ten | sum
! ------+-----+-----
!     0 |   0 |  12
!     0 |   8 |  12
!     0 |   4 |  12
!     1 |   5 |  15
!     1 |   9 |  15
!     1 |   1 |  15
!     2 |   6 |   8
!     2 |   2 |   8
!     3 |   3 |  10
!     3 |   7 |  10
! (10 rows)
!
  CREATE VIEW v_window AS
  	SELECT i, sum(i) over (order by i rows between 1 preceding and 1 following) as sum_rows,
  	sum(i) over (order by i / 3 range between 1 preceding and 1 following) as sum_range
--- 934,940 ----

  SELECT four, ten, sum(ten) over (partition by four order by four range 1 preceding)
  FROM tenk1 WHERE unique1 < 10;
! ERROR:  cannot extract system attribute from minimal tuple
  CREATE VIEW v_window AS
  	SELECT i, sum(i) over (order by i rows between 1 preceding and 1 following) as sum_rows,
  	sum(i) over (order by i / 3 range between 1 preceding and 1 following) as sum_range

======================================================================



regards,


Erik Rijkers



In response to

Responses

pgsql-hackers by date

Next:From: Simon RiggsDate: 2010-01-15 23:12:59
Subject: Re: Streaming replication, loose ends
Previous:From: Simon RiggsDate: 2010-01-15 23:09:13
Subject: Re: Hot Standby and handling max_standby_delay

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