8.4, 9.0 bug (doesn't exist in 9.1) related to window functions - Mailing list pgsql-bugs

From Jeff Davis
Subject 8.4, 9.0 bug (doesn't exist in 9.1) related to window functions
Date
Msg-id 1327622791.14650.8.camel@sussancws0025
Whole thread Raw
Responses Re: 8.4, 9.0 bug (doesn't exist in 9.1) related to window functions
List 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

pgsql-bugs by date:

Previous
From: Peter Geoghegan
Date:
Subject: Doc-bug; minor typo in auto_explain documentation
Next
From: Tom Lane
Date:
Subject: Re: 8.4, 9.0 bug (doesn't exist in 9.1) related to window functions