Re: Select query order

From: Sean Davis <sdavis2(at)mail(dot)nih(dot)gov>
To: Krithinarayanan Ganesh Kumar <krithinarayanan(at)gmail(dot)com>
Cc: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Select query order
Date: 2010-03-24 12:13:42
Message-ID: 264855a01003240513j3db5f79bx1b700b512fed86db@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Wed, Mar 24, 2010 at 8:06 AM, Krithinarayanan Ganesh Kumar
<krithinarayanan(at)gmail(dot)com> wrote:
> Hi All,
>
> I am aware that Select query does not guarantee the order of the rows
> returned ( The rows are returned in whatever order the system finds fastest
> to produce).
>
> Is there any way to SELECT the rows in the same order of insertion ? The
> problem is there is no Primary Key in the table, I am having only a
> composite key. So I cannot ORDER BY pk also.

Unless you have stored something in the table that correlates with the
order of insertion, I don't know of a way to get at the insertion
order as this information is not tracked by Postgresql.

Sean

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message A. Kretschmer 2010-03-24 12:22:11 Re: Select query order
Previous Message Krithinarayanan Ganesh Kumar 2010-03-24 12:06:08 Select query order