Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 80AD29FA18C for ; Thu, 7 Dec 2006 18:16:44 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 17006-03 for ; Thu, 7 Dec 2006 18:16:40 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from weatherbeeta.com.au (218-214-212-153.people.net.au [218.214.212.153]) by postgresql.org (Postfix) with SMTP id 83AAB9FA135 for ; Thu, 7 Dec 2006 18:16:42 -0400 (AST) Received: (qmail 2246 invoked from network); 7 Dec 2006 22:16:40 -0000 X-NetworkBox-HamSign: 0101;OUT;wbeetaau1;492984e0d1c15e159a41ebfc118982a0; Received: from mail.weatherbeeta.com.au (HELO SRV-Email) (172.20.0.2)by network-box.weatherbeeta.com.au with SMTP; 7 Dec 2006 22:16:39 -0000 Received: from it-phil.weatherbeeta.com.au ([172.20.0.155]) by SRV-Email (602Pro LAN SUITE 2003) id 2d6304f0 for pgsql-sql@postgresql.org; Fri, 8 Dec 2006 9:16:32 +1100 Reply-To: From: "Phillip Smith" To: Subject: could not find pathkey item to sort Date: Fri, 8 Dec 2006 09:16:29 +1100 Message-ID: <008c01c71a4d$59b0a020$9b0014ac@wbaus090> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_008D_01C71AA9.8D211820" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.6626 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962 Importance: Normal X-Scanned-By-wbeetaau1: Virus scan performed by network-box X-Scanned-By-wbeetaau1: Scanner file id is wbeetaau1-1165529799.987-2237-000 X-Scanned-By-wbeetaau1: No known viruses found in message (received+scanned in 0.05/0.12 secs) X-Scanned-By-wbeetaau1: Spam-Check-Result: No, hits=0 required=7 tests= autolearn=no version=2.0 X-Archive-Number: 200612/78 X-Sequence-Number: 27034 This is a multi-part message in MIME format. ------=_NextPart_000_008D_01C71AA9.8D211820 Content-Type: text/plain;charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi All, =20 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 =20 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 =20 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'; =20 I've tried creating an index and doing a reindex on the temp table = because the select to no avail. =20 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 =20 Phillip Smith IT Coordinator Weatherbeeta P/L 8 Moncrief Rd Nunawading, VIC, 3131 AUSTRALIA =20 E. phillips@weatherbeeta.com.au =20 *******************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 ------=_NextPart_000_008D_01C71AA9.8D211820 Content-Type: text/html;charset="us-ascii" Content-Transfer-Encoding: quoted-printable

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
------=_NextPart_000_008D_01C71AA9.8D211820--