Received: from localhost (unknown [200.46.204.184]) by developer.postgresql.org (Postfix) with ESMTP id A93082E0060 for ; Tue, 22 Apr 2008 07:32:19 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 57485-04-7 for ; Tue, 22 Apr 2008 07:32:03 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.251]) by developer.postgresql.org (Postfix) with ESMTP id EFDD52E00A8 for ; Tue, 22 Apr 2008 07:31:55 -0300 (ADT) Received: by an-out-0708.google.com with SMTP id c36so574909ana.33 for ; Tue, 22 Apr 2008 03:31:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; bh=DKIL/7ohiF6W5eLdem1n8kOVkxqAzW2FE2Et+eng7/o=; b=G7o74CBYCmENFs/csqS6izU5bcQnP8VSNOgFkTv+FQZO7kwBb5MXsS7y+BW5qeL8AgEFUDjZnMexxCMnES1XoTSHfhGgwv45ZcIvAnWj2cWH1zFOlr3B62bf45bRExWOcFLGaIBz8BgQz78fKoD+4Nol0CYf1RkbVRKNwvPe+Tk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=kbzdklbWLcYORWvl+FHUQ6x8xDHBZBzUYlcHJ+jiMN8raSt+XID7i7kE61a4hnVLQZAdPrL6P8NYKkTlqDPfGMiZrvd8Wfx9TKBYoXvNDwFIzTXwO+ewqgDXfJaOlRG2Eydmddkq1uFt3XygayFDhZKpLT46KvRZv/EAXHLzgJY= Received: by 10.100.242.20 with SMTP id p20mr14379204anh.153.1208860314875; Tue, 22 Apr 2008 03:31:54 -0700 (PDT) Received: by 10.70.25.5 with HTTP; Tue, 22 Apr 2008 03:31:54 -0700 (PDT) Message-ID: Date: Tue, 22 Apr 2008 12:31:54 +0200 From: "Nacef LABIDI" To: depesz@depesz.com Subject: Re: After updating dataset the record goes to the end of the dataset Cc: "Roland Voegtli" , pgsql-sql@postgresql.org In-Reply-To: <20080422101523.GB17162@depesz.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_2638_9542799.1208860314712" References: <3B256469-4A00-44C3-8EB8-F49FA9F7259A@scnat.ch> <20080422101523.GB17162@depesz.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200804/133 X-Sequence-Number: 30672 ------=_Part_2638_9542799.1208860314712 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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@depesz.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) > ------=_Part_2638_9542799.1208860314712 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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@depesz.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)

------=_Part_2638_9542799.1208860314712--