Re: Alter Table Command Rearranges Rows

From: Michael Glaesemann <grzm(at)seespotcode(dot)net>
To: Carlos Mennens <carlos(dot)mennens(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Alter Table Command Rearranges Rows
Date: 2010-09-17 20:32:52
Message-ID: 6E59D63B-87C8-467A-B541-96B331311D9F@seespotcode.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Sep 17, 2010, at 16:12 , Carlos Mennens wrote:

> I noticed that my database was in order based on my primary key column
> called 'id' which when from 1 (first) to 6 (last). Today I had to edit
> table data which wasn't anything crazy:
>
> team=#ALTER users SET name = 'David' WHERE id = '1';
> UPDATE 1

This isn't valid syntax: I believe you issued UPDATE users....

Postgres (nor any other SQL RDBMS) does not guarantee row order unless you specify it with an ORDER BY clause.

Michael Glaesemann
grzm seespotcode net

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joshua J. Kugler 2010-09-17 20:39:23 Re: missing chunk number 497 for toast value 504723663
Previous Message John DeSoi 2010-09-17 20:29:04 Re: Need magic for identifieing double adresses