Re: - Mailing list pgsql-sql

From Scott Marlowe
Subject Re:
Date
Msg-id dcc563d10811050914g4cf17d46q41cf32367abfecd7@mail.gmail.com
Whole thread Raw
In response to Re:  (Hemant Patel <hemant.patel@impetus.co.in>)
List pgsql-sql
On Wed, Nov 5, 2008 at 9:21 AM, Hemant Patel <hemant.patel@impetus.co.in> wrote:
> Let Say I have the array of primary key of some table say XYZ.
>
> For e.g. (555,222,333,111)
>
>
>
> When I query for these results I will get the result like  in the order of
> (111,222,333,555) .
>
> So now I need to process in the business logic to maintain the search
> criteria.

The fact that you get results in a certain order without using an
order by clause is a happy coincidence, and not to be relied upon.
Should PostgreSQL choose a different query plan they may come back in
some other order.

I.e. you HAVE to use an order by clause if you want a certain order.  period.


pgsql-sql by date:

Previous
From: Hemant Patel
Date:
Subject: Re:
Next
From: "Devil™ Dhuvader"
Date:
Subject: Re: need help in building a query