Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id DA0CDB6E2C4 for ; Thu, 26 Jan 2012 22:06:26 -0400 (AST) Received: from mail-iy0-f174.google.com ([209.85.210.174]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RqbCq-0006VD-C1 for pgsql-bugs@postgresql.org; Fri, 27 Jan 2012 02:06:26 +0000 Received: by iacb35 with SMTP id b35so1470334iac.19 for ; Thu, 26 Jan 2012 18:06:11 -0800 (PST) Received: by 10.42.151.195 with SMTP id f3mr3671667icw.19.1327629970144; Thu, 26 Jan 2012 18:06:10 -0800 (PST) Received: from ?IPv6:::1? (li224-40.members.linode.com. [173.255.214.40]) by mx.google.com with ESMTPS id ba5sm2567228igb.6.2012.01.26.18.06.08 (version=SSLv3 cipher=OTHER); Thu, 26 Jan 2012 18:06:09 -0800 (PST) Subject: Re: 8.4, 9.0 bug (doesn't exist in 9.1) related to window functions From: Jeff Davis To: Tom Lane Cc: pgsql-bugs@postgresql.org In-Reply-To: <16536.1327628584@sss.pgh.pa.us> References: <1327622791.14650.8.camel@sussancws0025> <16536.1327628584@sss.pgh.pa.us> Content-Type: text/plain; charset="ISO-8859-1" Date: Thu, 26 Jan 2012 18:06:07 -0800 Message-ID: <1327629967.9123.4.camel@sussancws0025> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201201/186 X-Sequence-Number: 32253 On Thu, 2012-01-26 at 20:43 -0500, Tom Lane wrote: > Jeff Davis writes: > > => 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=postgresql.git;a=commitdiff;h=c1d9579dd > > and as noted in that commit message, it didn't appear worth the risk > of fixing it in released branches. Thank you. For the record, it looks like the one that fixed the similar problem in early 9.1 was here: http://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=269c5dd2f46e3490da05d5dd5dad07828df281d9 Regards, Jeff Davis