SERIAL datatype column skipping values. - Mailing list pgsql-hackers

From Prabhat Sahu
Subject SERIAL datatype column skipping values.
Date
Msg-id CANEvxPoucYsv2XEByT1UOK13nwR_=Z5dqV4F71Oi8PJ_ihT++g@mail.gmail.com
Whole thread Raw
Responses Re: SERIAL datatype column skipping values.  (Andreas Karlsson <andreas@proxel.se>)
List pgsql-hackers
Hi all,
Please check the below behavior for the "SERIAL" datatype.

postgres=# CREATE TABLE t1(c1 int, c2 serial);
CREATE TABLE
postgres=# insert into t1 values (generate_series(1,3));
INSERT 0 3
postgres=# insert into t1 values (generate_series(4,6));
INSERT 0 3
postgres=# select * from t1;
 c1 | c2
----+----
  1 |  1
  2 |  2
  3 |  3
  4 |  5
  5 |  6
  6 |  7
(6 rows)

In this above case, the serial column "c2" is skipping the value "4" in select output. 
Is this an expected behavior?

--

With Regards,
Prabhat Kumar Sahu
EnterpriseDB: http://www.enterprisedb.com

pgsql-hackers by date:

Previous
From: Dilip Kumar
Date:
Subject: Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager
Next
From: Hugh McMaster
Date:
Subject: Re: [PATCH] Use PKG_CHECK_MODULES to detect the libxml2 library