dbTalk Databases Forums  

[BUGS] 8.4, 9.0 bug (doesn't exist in 9.1) related to window functions

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] 8.4, 9.0 bug (doesn't exist in 9.1) related to window functions in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jeff Davis
 
Posts: n/a

Default [BUGS] 8.4, 9.0 bug (doesn't exist in 9.1) related to window functions - 01-26-2012 , 06:06 PM






In REL8_4_STABLE and REL9_0_STABLE:

=> select ntile(3) OVER ( ORDER BY CASE WHEN count(i) = 0 THEN NULL ELSE
count(i) END asc ) from ( SELECT NULL::integer as i limit 0 ) s ;
ERROR: cannot extract attribute from empty tuple slot

A different error appears in 9.1.0 ("could not find pathkey item to
sort"), but it's fixed sometime later in the 9.1 series.

If you get rid of the CASE statement, then it still fails in 8.4 and
9.0, but it succeeds in 9.1.0 and beyond.

Regards,
Jeff Davis


--
Sent via pgsql-bugs mailing list (pgsql-bugs (AT) postgresql (DOT) org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] 8.4, 9.0 bug (doesn't exist in 9.1) related to window functions - 01-26-2012 , 07:43 PM






Jeff Davis <pgsql (AT) j-davis (DOT) com> writes:
Quote:
In REL8_4_STABLE and REL9_0_STABLE:

=> select ntile(3) OVER ( ORDER BY CASE WHEN count(i) = 0 THEN NULL ELSE
count(i) END asc ) from ( SELECT NULL::integer as i limit 0 ) s ;
ERROR: cannot extract attribute from empty tuple slot
I believe this is the same case fixed here:
http://git.postgresql.org/gitweb/?p=...ff;h=c1d9579dd

and as noted in that commit message, it didn't appear worth the risk
of fixing it in released branches.

regards, tom lane

--
Sent via pgsql-bugs mailing list (pgsql-bugs (AT) postgresql (DOT) org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.