X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 0CAD19DC842 for ; Fri, 13 Jan 2006 10:56:10 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 18023-09 for ; Fri, 13 Jan 2006 10:56:12 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 875F99DC815 for ; Fri, 13 Jan 2006 10:56:04 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id k0DEu8kY025012; Fri, 13 Jan 2006 09:56:08 -0500 (EST) To: Adam Rosi-Kessel cc: pgsql-sql@postgresql.org Subject: Re: ORDER BY does not work as expected with multiple joins In-reply-to: <43C7BA12.90103@rosi-kessel.org> References: <43C7BA12.90103@rosi-kessel.org> Comments: In-reply-to Adam Rosi-Kessel message dated "Fri, 13 Jan 2006 09:32:50 -0500" Date: Fri, 13 Jan 2006 09:56:08 -0500 Message-ID: <25011.1137164168@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.087 required=5 tests=[AWL=0.087] X-Spam-Score: 0.087 X-Spam-Level: X-Archive-Number: 200601/60 X-Sequence-Number: 23849 Adam Rosi-Kessel writes: > I have a multijoin SELECT statement where the ORDER BY clause doesn't > seem to be working. You haven't mentioned your Postgres version, nor provided anywhere near enough information to let other people reproduce the problem. You might find it helpful to read this: http://www.postgresql.org/docs/8.1/static/bug-reporting.html One comment is that your joining seems wrong: I'd have thought the RIGHT JOIN should be LEFT JOIN for what you're trying to do. But that shouldn't make any difference to whether the sort order is correct. regards, tom lane