pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedpg 9.1.1 - ERROR: could not find pathkey item to sort
3+ messages / 2 participants
[nested] [flat]
* pg 9.1.1 - ERROR: could not find pathkey item to sort
@ 2011-09-27 00:37 bricklen <bricklen@gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: bricklen @ 2011-09-27 00:37 UTC (permalink / raw)
To: pgsql-bugs
Is this a bug, or due to the way I am using the RANK() function in the
following query? The error is triggered when I use (sum(y) / sum(x))
in the ORDER BY of the RANK() function.
Simple test case:
create table t (a int, b int, x numeric, y integer );
insert into t
select g,round(mod(g,4)),
round((random()*1000)::NUMERIC,2),round((random()*1000)::NUMERIC) from
generate_series(1, 100) as g;
select a,
b,
(sum(y) / sum(x)) as res,
rank() over (partition by a,b order by (sum(y) / sum(x)) desc) as rank
--rank() over (partition by a,b order by sum(y) desc) as rank
-- no error
from t
group by a,b;
select version();
version
--------------------------------------------------------------------------------------------------------------
PostgreSQL 9.1.1 on x86_64-unknown-linux-gnu, compiled by gcc (GCC)
4.4.5 20110214 (Red Hat 4.4.5-6), 64-bit
Any other details needed?
Cheers,
Bricklen
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: pg 9.1.1 - ERROR: could not find pathkey item to sort
@ 2011-09-27 00:46 Tom Lane <tgl@sss.pgh.pa.us>
parent: bricklen <bricklen@gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Tom Lane @ 2011-09-27 00:46 UTC (permalink / raw)
To: bricklen <bricklen@gmail.com>; +Cc: pgsql-bugs
bricklen <bricklen@gmail.com> writes:
> Is this a bug,
Yes. Thanks for the test case, will look.
regards, tom lane
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: pg 9.1.1 - ERROR: could not find pathkey item to sort
@ 2011-09-27 04:03 Tom Lane <tgl@sss.pgh.pa.us>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 3+ messages in thread
From: Tom Lane @ 2011-09-27 04:03 UTC (permalink / raw)
To: bricklen <bricklen@gmail.com>; +Cc: pgsql-bugs
I wrote:
> bricklen <bricklen@gmail.com> writes:
>> Is this a bug,
> Yes. Thanks for the test case, will look.
Fixed, patch is at
http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=1679e9feddc94bd7372a6829db92868e55...
regards, tom lane
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2011-09-27 04:03 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-09-27 00:37 pg 9.1.1 - ERROR: could not find pathkey item to sort bricklen <bricklen@gmail.com>
2011-09-27 00:46 ` Tom Lane <tgl@sss.pgh.pa.us>
2011-09-27 04:03 ` Tom Lane <tgl@sss.pgh.pa.us>
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