From: chuisiniu@hotmail.com
To: pgsql-bugs@postgresql.org
Subject: BUG #10429: the same update return different result
Date: Fri, 23 May 2014 07:41:25 +0000
Message-ID: <20140523074125.2687.92046@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
The following bug has been logged on the website:
Bug reference: 10429
Logged by: zhanglong
Email address: chuisiniu@hotmail.com
PostgreSQL version: 9.3.4
Operating system: window7 32bit
Description:
E:\postgresql-9.4beta1\db\bin>psql postgres
psql (9.4beta1)
Type "help" for help.
postgres=# drop table t1;
DROP TABLE
postgres=# create table t1(c1 int primary key);
CREATE TABLE
postgres=# insert into t1 values (1);insert into t1 values (2);update t1 set
c1 = c1 +1;
INSERT 0 1
INSERT 0 1
ERROR: duplicate key value violates unique constraint "t1_pkey"
DETAIL: Key (c1)=(2) already exists.
postgres=# select * from t1;
c1
----
1
2
(2 rows)
postgres=#
postgres=# drop table t1;
DROP TABLE
postgres=# create table t1(c1 int primary key);
CREATE TABLE
postgres=# insert into t1 values (2);insert into t1 values (1);update t1 set
c1 = c1 +1;
INSERT 0 1
INSERT 0 1
UPDATE 2
postgres=# select * from t1;
c1
----
3
2
(2 rows)
The data is all the same except the order I insert it,but the update get
different result.From the source code, it seems that db update the tuple
first found out.
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: chuisiniu@hotmail.com
Subject: Re: BUG #10429: the same update return different result
In-Reply-To: <20140523074125.2687.92046@wrigleys.postgresql.org>
References: <20140523074125.2687.92046@wrigleys.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox