Received: from localhost (unknown [200.46.204.184]) by developer.postgresql.org (Postfix) with ESMTP id 9D7032E0031 for ; Mon, 21 Apr 2008 03:09:25 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 55884-06 for ; Mon, 21 Apr 2008 03:09:19 -0300 (ADT) Received: from mx2.hub.org (mx2.hub.org [200.46.204.254]) by developer.postgresql.org (Postfix) with ESMTP id 566562E002C for ; Mon, 21 Apr 2008 03:09:22 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from email.thns.co.th (unknown [58.137.49.20]) by mx2.hub.org (Postfix) with ESMTP id CADC212A69F0 for ; Mon, 21 Apr 2008 03:09:17 -0300 (ADT) Received: from localhost (localhost.localdomain [127.0.0.1]) by email.thns.co.th (Postfix) with ESMTP id BD2B619E79 for ; Mon, 21 Apr 2008 13:11:26 +0700 (ICT) X-Virus-Scanned: amavisd-new at thns.co.th Received: from email.thns.co.th ([127.0.0.1]) by localhost (email.thns.co.th [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id M8XBn8YOStdC for ; Mon, 21 Apr 2008 13:11:26 +0700 (ICT) Received: from [172.27.170.219] (unknown [172.27.170.219]) by email.thns.co.th (Postfix) with ESMTP id 1EAAD19E78 for ; Mon, 21 Apr 2008 13:11:25 +0700 (ICT) Message-ID: <480D3AB5.5010900@thns.co.th> Date: Mon, 21 Apr 2008 13:09:09 -1200 From: Theerasak Maneeneim Reply-To: theerasak@thns.co.th User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Error: could not find pathkey item to sort X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=3.349 tagged_above=0 required=5 tests=AWL=0.050, DATE_IN_FUTURE_12_24=3.299 X-Spam-Level: *** X-Archive-Number: 200804/121 X-Sequence-Number: 30660 Hi Everyone, I had some problem with postgresql 8.3.1. I had got an error message, ERROR: could not find pathkey item to sort, when I use this query statement: SELECT INTO wk_fcstrec_dt DISTINCT MAX(fcstrec_dt) FROM a_cusfcst WHERE cscd = '2203' AND cs_partno = '35732SSA' AND delipnt_no = '001' AND plantcd_no = '003' AND locatto = trim(both FROM 'SS') AND fcstrec_dt < '20080910' AND latest_flg = 'N'; I have not ever seen the error in version 8.1 and 8.2. Now, I have already revised my program by removed the word "DISTINCT" but I want to know what is cause of this error. Could you please to explain to me? Thank you very much.