From: Phillip Smith <phillips@weatherbeeta.com.au>
To: pgsql-sql@postgresql.org
Subject: could not find pathkey item to sort
Date: Fri, 8 Dec 2006 09:16:29 +1100
Message-ID: <008c01c71a4d$59b0a020$9b0014ac@wbaus090> (raw)
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@weatherbeeta.com.au
*******************Confidentiality 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
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 using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: phillips@weatherbeeta.com.au
Subject: Re: could not find pathkey item to sort
In-Reply-To: <008c01c71a4d$59b0a020$9b0014ac@wbaus090>
* 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