pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Goodwin <dof@codepoets.co.uk>
Cc: DIB Walid <walid.dib@inrialpes.fr>
Cc: pgsql-sql@postgresql.org
Subject: Re: ordering problems ...
Date: Tue, 15 Apr 2003 09:49:45 -0400
Message-ID: <7558.1050414585@sss.pgh.pa.us> (raw)
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>

David Goodwin <dof@codepoets.co.uk> 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




view thread (3+ messages)

Message-ID: <7558.1050414585@sss.pgh.pa.us>
Permalink:  ../7558.1050414585@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/7558.1050414585@sss.pgh.pa.us

 · 

reply

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: tgl@sss.pgh.pa.us, dof@codepoets.co.uk, walid.dib@inrialpes.fr
  Subject: Re: ordering problems ...
  In-Reply-To: <7558.1050414585@sss.pgh.pa.us>

* 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