Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id 7A9DC2E0092 for ; Tue, 22 Apr 2008 07:12:50 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 68112-02 for ; Tue, 22 Apr 2008 07:12:42 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.178]) by developer.postgresql.org (Postfix) with ESMTP id 35A082E007E for ; Tue, 22 Apr 2008 07:12:38 -0300 (ADT) Received: by py-out-1112.google.com with SMTP id d37so3263147pye.29 for ; Tue, 22 Apr 2008 03:12:37 -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=Zo1h8JfzJhAWOzuUqkAbv4JB7v+uhJ66xmYPCgTw35U=; b=t+g5Qvb3CjTbGxE9RGK7yUyblsIz4qP+tMqoHdwOFITUBafsmwzN0HFLoIfIFVtQCma6BcljTP4hlONKvV3zsiVehF+hFwUvukeZe1PulePbGUH29/8LgSoBLQWIgllNEL9/iDxA6M4S9DOJzUC/V4pZF2L3rcHV4obxETSr1TI= 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=c3+Ga0sfrvgjOW0vwGuXdMLR1Qe3NxvoKBxz2bcsxhoTVxHkJPpDTm6i+/nTH6zK0GVCptXmYdFK42lOY7pdOv3XF4oMNjScAtfW3jj6GUsFNz4Mt3HW9/XnlQa1MEsIs+HK26APmGsB1RD9m3kwCSoNcWfsuEzvRsTemdSVYzc= Received: by 10.141.87.13 with SMTP id p13mr9410rvl.55.1208859157144; Tue, 22 Apr 2008 03:12:37 -0700 (PDT) Received: by 10.141.98.7 with HTTP; Tue, 22 Apr 2008 03:12:37 -0700 (PDT) Message-ID: <65937bea0804220312s2e873084n4741fa8e1cc3e26b@mail.gmail.com> Date: Tue, 22 Apr 2008 15:42:37 +0530 From: "Gurjeet Singh" To: "Nacef LABIDI" Subject: Re: After updating dataset the record goes to the end of the dataset Cc: pgsql-sql@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_17756_31192562.1208859157140" References: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200804/131 X-Sequence-Number: 30670 ------=_Part_17756_31192562.1208859157140 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On Tue, Apr 22, 2008 at 3:24 PM, Nacef LABIDI wrote: > Hi all, > > I am using Postgres in a Delphi application through ODBC. I am having an > issue with updating records. > > When I create a dataset to get the records in a table then after I update > one of these records and then refresh the dataset, the record goes to the > end of the dataset. This is disappointing when editing records on a DBGrid, > where users find their updated records jump to the end of the grid. Even > after restarting the application, the updated record keeps showing at the > end of the grid. I have tried the same thing with SQL Server and it works > normally, so I thought it was a postgres behvior. > > Has anyone an idea about what could be the cause of such a behavior. > The data is not guaranteed to be ordered if you do not specify an ORDER BY clause in your query. Try adding a meaningful ORDER BY clause, that should solve the problem. HTH, Best regards, -- gurjeet[.singh]@EnterpriseDB.com singh.gurjeet@{ gmail | hotmail | indiatimes | yahoo }.com EnterpriseDB http://www.enterprisedb.com Mail sent from my BlackLaptop device ------=_Part_17756_31192562.1208859157140 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On Tue, Apr 22, 2008 at 3:24 PM, Nacef LABIDI <nacef.l@gmail.com> wrote:
Hi all,

I am using Postgres in a Delphi application through ODBC. I am having an issue with updating records.

When I create a dataset to get the records in a table then after I update one of these records and then refresh the dataset, the record goes to the end of the dataset. This is disappointing when editing records on a DBGrid, where users find their updated records jump to the end of the grid. Even after restarting the application, the updated record keeps showing at the end of the grid. I have tried the same thing with SQL Server and it works normally, so I thought it was a postgres behvior.

Has anyone an idea about what could be the cause of such a behavior.

The data is not guaranteed to be ordered if you do not specify an ORDER BY clause in your query. Try adding a meaningful ORDER BY clause, that should solve the problem.

HTH,

Best regards,
--
gurjeet[.singh]@EnterpriseDB.com
singh.gurjeet@{ gmail | hotmail | indiatimes | yahoo }.com

EnterpriseDB http://www.enterprisedb.com

Mail sent from my BlackLaptop device ------=_Part_17756_31192562.1208859157140--