pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: meixiangming@huawei.com
To: pgsql-bugs@postgresql.org
Subject: BUG #6748: sequence value may be conflict in some cases
Date: Mon, 23 Jul 2012 01:51:56 +0000
Message-ID: <E1St7oS-0004Rg-Oc@wrigleys.postgresql.org> (raw)

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,      //自增序列,等同于sequence
  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'.




view thread (3+ messages)  latest in thread

Message-ID: <E1St7oS-0004Rg-Oc@wrigleys.postgresql.org>
Permalink:  ../E1St7oS-0004Rg-Oc@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/E1St7oS-0004Rg-Oc@wrigleys.postgresql.org

 · 

reply

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: meixiangming@huawei.com
  Subject: Re: BUG #6748: sequence value may be conflict in some cases
  In-Reply-To: <E1St7oS-0004Rg-Oc@wrigleys.postgresql.org>
  References: <E1St7oS-0004Rg-Oc@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