Home > Archive > PostgreSQL SQL > December 2006 > could not find pathkey item to sort









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author could not find pathkey item to sort
Phillip Smith

2006-12-07, 7:15 pm

Hi All,



Since upgrading to PG 8.2, I'm getting this error on a nightly (bash) script
that calls psql (it's purpose is to find stock codes that share an EAN
Barcode with another code - it used to work, now doesn't):

ERROR: could not find pathkey item to sort

SQL state: XX000



The error is because of the ORDER BY clause of this query:

SELECT code, description, ean

FROM $TMPTABLE

WHERE ean <> ''

AND ean IN (SELECT ean FROM $TMPTABLE GROUP BY ean HAVING count(ean) >
1)

ORDER BY ean



The $TMPTABLE is created as per:

CREATE TEMP TABLE $TMPTABLE

(

code varchar(6),

description varchar(38),

grp varchar(4),

brand text,

style text,

supplier varchar(6),

supplier_code text,

wholesale numeric(10,2),

retail numeric(10,2),

ean varchar(13)

)

WITHOUT OIDS;

-- Import the file from WB Database

COPY $TMPTABLE FROM '$TMPFILE';



I've tried creating an index and doing a reindex on the temp table because
the select to no avail.



Any help would be great - I've "fixed" it at the moment by commenting the
ORDER BY clause, but it would be nice to have it sorted properly, and also
in case it happens in any other tables.

Thanks,

-p



Phillip Smith
IT Coordinator
Weatherbeeta P/L
8 Moncrief Rd
Nunawading, VIC, 3131
AUSTRALIA

E. phillips@weatherbeet
a.com.au





*******************C
onfidentiality and Privilege Notice**************
*****

The material contained in this message is privileged and confidential to
the addressee. If you are not the addressee indicated in this message or
responsible for delivery of the message to such person, you may not copy
or deliver this message to anyone, and you should destroy it and kindly
notify the sender by reply email.

Information in this message that does not relate to the official business
of Weatherbeeta must be treated as neither given nor endorsed by Weatherbeeta.
Weatherbeeta, its employees, contractors or associates shall not be liable
for direct, indirect or consequential loss arising from transmission of this
message or any attachments

Tom Lane

2006-12-07, 7:15 pm

"Phillip Smith" < phillips@weatherbeet
a.com.au> writes:
> Since upgrading to PG 8.2, I'm getting this error on a nightly (bash)
> script
> ERROR: could not find pathkey item to sort


I think this is a variant manifestation of the same bug already reported
here:
http://archives.postgresql.org/pgsq...12/msg00284.php
and fixed here:
http://archives.postgresql.org/pgsq...12/msg00056.php

Leastwise, it went away for me after applying that patch ...

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com