Search Postgresql Archives

Re: Gaps in PK sequence numbers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 10 Jun 2024, David G. Johnston wrote:

For efficiency the only thing used to determine the next value of a
sequence is the stored value of the last sequence value issued. Where that
value may have been used, in a table as a PK or some other purpose, does
not enter into it. Using a sequence as a default does indeed become
problematic if you don't use it exclusively. If you do use it exclusively
usually you just set the last value to be the maximum needed and use it
going forward. The numbers from deleted rows simply remain missing in the
table.

David,

Thanks for the explanation. I had entered PKs without using the sequence.

Regards,

Rich





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux