Search Postgresql Archives

Re: I have a select statement on the issue.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Mittwoch, 28. November 2007, gongzhixiao@xxxxxxxxx wrote:
| Step 4:Update Date
| update test set name='1111name' where code='1002'

Simplified, when you perform an update, PostgreSQL internally marks 
the affected row as deleted and inserts a new row in the table. For details
look at the MVCC documentation, eg.

  http://www.postgresql.org/docs/8.2/interactive/mvcc-intro.html

| Results:
| code name     qty
| 1001 1001name  1
| 1003 1003name  3
| 1002 1111name  2
|
| Question:
| 1. Why the default output changes after I execute the update statement?

See above; output order is not guaranteed without order clause.

| 2. Qustion, sorting as main keys when query, how to do?

You mean: select * from test order by code ?


Ciao,
Thomas

-- 
Thomas Pundt <thomas.pundt@xxxxxxxxxxxx> ---- http://rp-online.de/ ----

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux