pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
8.4, 9.0 bug (doesn't exist in 9.1) related to window functions
3+ messages / 2 participants
[nested] [flat]

* 8.4, 9.0 bug (doesn't exist in 9.1) related to window functions
@ 2012-01-27 00:06 Jeff Davis <pgsql@j-davis.com>
  2012-01-27 01:43 ` Re: 8.4, 9.0 bug (doesn't exist in 9.1) related to window functions Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 3+ messages in thread

From: Jeff Davis @ 2012-01-27 00:06 UTC (permalink / raw)
  To: 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




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: 8.4, 9.0 bug (doesn't exist in 9.1) related to window functions
  2012-01-27 00:06 8.4, 9.0 bug (doesn't exist in 9.1) related to window functions Jeff Davis <pgsql@j-davis.com>
@ 2012-01-27 01:43 ` Tom Lane <tgl@sss.pgh.pa.us>
  2012-01-27 02:06   ` Re: 8.4, 9.0 bug (doesn't exist in 9.1) related to window functions Jeff Davis <pgsql@j-davis.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 2012-01-27 01:43 UTC (permalink / raw)
  To: Jeff Davis <pgsql@j-davis.com>; +Cc: pgsql-bugs

Jeff Davis <pgsql@j-davis.com> writes:
> 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=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.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: 8.4, 9.0 bug (doesn't exist in 9.1) related to window functions
  2012-01-27 00:06 8.4, 9.0 bug (doesn't exist in 9.1) related to window functions Jeff Davis <pgsql@j-davis.com>
  2012-01-27 01:43 ` Re: 8.4, 9.0 bug (doesn't exist in 9.1) related to window functions Tom Lane <tgl@sss.pgh.pa.us>
@ 2012-01-27 02:06   ` Jeff Davis <pgsql@j-davis.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Jeff Davis @ 2012-01-27 02:06 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-bugs

On Thu, 2012-01-26 at 20:43 -0500, Tom Lane wrote:
> Jeff Davis <pgsql@j-davis.com> 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=269c5dd2f46e3490da05d5dd5dad07828df281...

Regards,
	Jeff Davis




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2012-01-27 02:06 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2012-01-27 00:06 8.4, 9.0 bug (doesn't exist in 9.1) related to window functions Jeff Davis <pgsql@j-davis.com>
2012-01-27 01:43 ` Tom Lane <tgl@sss.pgh.pa.us>
2012-01-27 02:06   ` Jeff Davis <pgsql@j-davis.com>

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