Oracle Sequence starting with 2 instead of 1

前端 未结 4 2102
别那么骄傲
别那么骄傲 2020-12-10 04:16

Unexpected behavior:

I am encountering strange behavior of Oracle sequences with 11g (works with 10g):

CREATE SEQUENCE test_sequence         


        
4条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-10 05:00

    I can't reproduce on 11G, i.e. the table contains a 1 after following your steps.

    However, it is debatable whether this should be considered an "issue", because sequences are never guaranteed to be gap-free. What START WITH guarantees is that the sequence will never return a value lower than the specified starting value - e.g. to avoid conflicts with existing data. I do agree however that what you are seeing is surprising and I would be interested to know the reason!

提交回复
热议问题