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

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: 8.4, 9.0 bug (doesn't exist in 9.1) related to window functions
Date: 2012-01-27 00:06:31
Message-ID: 1327622791.14650.8.camel@sussancws0025
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2012-01-27 01:43:04 Re: 8.4, 9.0 bug (doesn't exist in 9.1) related to window functions
Previous Message Peter Geoghegan 2012-01-26 22:45:49 Doc-bug; minor typo in auto_explain documentation