SERIAL datatype column skipping values.

From: Prabhat Sahu <prabhat(dot)sahu(at)enterprisedb(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: SERIAL datatype column skipping values.
Date: 2020-03-11 10:15:42
Message-ID: CANEvxPoucYsv2XEByT1UOK13nwR_=Z5dqV4F71Oi8PJ_ihT++g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hugh McMaster 2020-03-11 10:24:10 Re: [PATCH] Use PKG_CHECK_MODULES to detect the libxml2 library
Previous Message Dilip Kumar 2020-03-11 09:51:50 Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager