Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hC6jF-0007ch-V2 for pgsql-general@arkaria.postgresql.org; Thu, 04 Apr 2019 18:04:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hC6jE-0002nx-LS for pgsql-general@arkaria.postgresql.org; Thu, 04 Apr 2019 18:04:44 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hC6jE-0002nk-BG for pgsql-general@lists.postgresql.org; Thu, 04 Apr 2019 18:04:44 +0000 Received: from mail.appl-ecosys.com ([50.126.108.78]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hC6jC-0000QK-20 for pgsql-general@lists.postgresql.org; Thu, 04 Apr 2019 18:04:43 +0000 Received: from salmo.appl-ecosys.com (salmo.appl-ecosys.com [192.168.55.1]) by mail.appl-ecosys.com (Postfix) with ESMTP id 0E34D99374 for ; Thu, 4 Apr 2019 11:04:39 -0700 (PDT) Date: Thu, 4 Apr 2019 11:04:39 -0700 (PDT) From: Rich Shepard Reply-To: Rich Shepard To: pgsql-general@lists.postgresql.org Subject: How serial primary key numbers are assigned Message-ID: User-Agent: Alpine 2.20 (LNX 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Just out of curiosity, how does postgres assign serial primary key identifiers when rows are inserted in multiple, separate working sessions? I'm populating tables using INSERT INTO statements in separate working sessions and see that the assigned id numbers are sequential in each session, but have large gaps from one session to the next. I don't care what id numbers are assigned yet would like to know how the starting number for each session is determined, just because I expected the numbers to be continuous. Regards, Rich