pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeff Davis <pgsql@j-davis.com>
To: pgsql-bugs@postgresql.org
Subject: 8.4, 9.0 bug (doesn't exist in 9.1) related to window functions
Date: Thu, 26 Jan 2012 16:06:31 -0800
Message-ID: <1327622791.14650.8.camel@sussancws0025> (raw)


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




view thread (3+ messages)  latest in thread

Message-ID: <1327622791.14650.8.camel@sussancws0025>
Permalink:  ../1327622791.14650.8.camel@sussancws0025/
Also on:    postgresql.org/message-id/1327622791.14650.8.camel@sussancws0025

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: pgsql@j-davis.com
  Subject: Re: 8.4, 9.0 bug (doesn't exist in 9.1) related to window functions
  In-Reply-To: <1327622791.14650.8.camel@sussancws0025>
  References: <1327622791.14650.8.camel@sussancws0025>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox