X-Original-To: pgsql-sql@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 372B247634D for ; Tue, 15 Apr 2003 09:49:54 -0400 (EDT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 2C41B476348 for ; Tue, 15 Apr 2003 09:49:52 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h3FDnjU6007559; Tue, 15 Apr 2003 09:49:45 -0400 (EDT) To: David Goodwin Cc: DIB Walid , pgsql-sql@postgresql.org Subject: Re: ordering problems ... In-reply-to: <20030415104749.GA3191@codepoets.co.uk> References: <20030415103328.GA3076@codepoets.co.uk> <200304151042.h3FAgqO20812@imap-serv.inrialpes.fr> <20030415104749.GA3191@codepoets.co.uk> Comments: In-reply-to David Goodwin message dated "Tue, 15 Apr 2003 11:47:50 +0100" Date: Tue, 15 Apr 2003 09:49:45 -0400 Message-ID: <7558.1050414585@sss.pgh.pa.us> From: Tom Lane X-Spam-Status: No, hits=-32.5 required=5.0 tests=BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT, REFERENCES,REPLY_WITH_QUOTES autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/226 X-Sequence-Number: 12927 David Goodwin writes: > I just discovered that if i put in a "order by qra.oid" it works ok. That isn't going to work for long --- for example, as soon as you update any row in question_response_answer, physical order will stop matching OID order. The real answer to your question is that SQL does not consider the ordering of a table to be significant. If you want the rows of a query result to be displayed in a particular order, you have to use ORDER BY. Without that, the system is entitled to deliver the rows in any order it finds convenient. regards, tom lane