Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id C72EB1E78896 for ; Sun, 22 Jul 2012 22:52:22 -0300 (ADT) Received: from mahout.postgresql.org ([98.129.198.123]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1St7ok-0001Mh-GJ for pgsql-bugs@postgresql.org; Mon, 23 Jul 2012 01:52:21 +0000 Received: from [204.145.124.246] (helo=wrigleys.postgresql.org) by mahout.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1St7oT-00037P-6Q for pgsql-bugs@postgresql.org; Mon, 23 Jul 2012 01:52:00 +0000 Received: from www-data by wrigleys.postgresql.org with local (Exim 4.72) (envelope-from ) id 1St7oS-0004Rg-Oc for pgsql-bugs@postgresql.org; Mon, 23 Jul 2012 01:51:56 +0000 Date: Mon, 23 Jul 2012 01:51:56 +0000 Message-Id: Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #6748: sequence value may be conflict in some cases To: pgsql-bugs@postgresql.org From: meixiangming@huawei.com X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201207/184 X-Sequence-Number: 33660 The following bug has been logged on the website: Bug reference: 6748 Logged by: Xiangming Mei Email address: meixiangming@huawei.com PostgreSQL version: 9.1.4 Operating system: SUSE 11 X64 Description: = Reproduce steps: 1. create a table using serial such as: CREATE TABLE tbl_aaa ( sno serial NOT NULL, //=E8=87=AA=E5=A2=9E=E5=BA=8F=E5=88=97=EF=BC=8C= =E7=AD=89=E5=90=8C=E4=BA=8Esequence userid int NOT NULL, CONSTRAINT tbl_aaa_pkey PRIMARY KEY (sno) ); 2. insert a tuple: INSERT INTO tbl_aaa values (DEFAULT, 1); 3. postgersql instance crashed, may be power lost or killed by someone: 4. restart the instance then insert another tuple into tbl_aaa, you will get a error message: INSERT INTO tbl_aaa values (DEFAULT, 2); ERROR: SQLSTATE 23505: duplicate key value violates unique constraint "tbl_aaa_pkey" LOCATION: _bt_check_unique, nbtinsert.c:300 I think this is because there is no logit when 'is_called' become from 'f' to 't'.