Re: After updating dataset the record goes to the end of the dataset

From: "Nacef LABIDI" <nacef(dot)l(at)gmail(dot)com>
To: depesz(at)depesz(dot)com
Cc: "Roland Voegtli" <voegtli(at)scnat(dot)ch>, pgsql-sql(at)postgresql(dot)org
Subject: Re: After updating dataset the record goes to the end of the dataset
Date: 2008-04-22 10:31:54
Message-ID: f16f7ea00804220331u226df1ean9a17e12d9324e078@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

You are right about the fact that the rows don't keep the order they where
created with at the start. I have verfied this.

I will explain more my case :

I am writing an application where here is some resources to plan events on.
I want to provide the user with the ability to customize the order in which
resources are displayed on the screen. So there is a mapping between the
rows positions in the dataset and they display positions. After updating one
of these resources the row jumps to the end of the dataset so does the
resource on the display. And the order gets scrambled. I cannot set this
order in the databe since it is customizable for each user.

When I have tested this with SQLServer it works well, since the rows doesn't
change position on the DB.

I hope that you understand my issue and I will provide any explanations if
someting isn't clear enough.

Thanks to all
Nacef

On Tue, Apr 22, 2008 at 12:15 PM, hubert depesz lubaczewski <
depesz(at)depesz(dot)com> wrote:

> On Tue, Apr 22, 2008 at 12:10:41PM +0200, Nacef LABIDI wrote:
> > Yes I don't issue any sort statement, and I indeed want the data to be
> show
> > as it is stored in the database. But after updating a row (I don't
> update
> > the ID, just some fields), it keeps its same place on the DB but jumps
> to
> > the end of the dataset and by the way to the end of the DBGrid.
>
> why do you think it stays in the same place in db?
>
> besides - without "order by" you cannot depend on the order of rows.
> basically i treat them as in "random" order (which is not true, but
> helps me remember to never count on the "default" ordering.
>
> depesz
>
> --
> quicksil1er: "postgres is excellent, but like any DB it requires a
> highly paid DBA. here's my CV!" :)
> http://www.depesz.com/ - blog dla ciebie (i moje CV)
>

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Pavan Deolasee 2008-04-22 10:45:10 Re: After updating dataset the record goes to the end of the dataset
Previous Message hubert depesz lubaczewski 2008-04-22 10:15:23 Re: After updating dataset the record goes to the end of the dataset