Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nu4yk-0006S2-72 for pgsql-general@arkaria.postgresql.org; Thu, 26 May 2022 04:20:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nu4yj-0006as-1h for pgsql-general@arkaria.postgresql.org; Thu, 26 May 2022 04:20:05 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nu4yh-0006Xn-DI for pgsql-general@lists.postgresql.org; Thu, 26 May 2022 04:20:04 +0000 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nu4yZ-0002tc-3B for pgsql-general@lists.postgresql.org; Thu, 26 May 2022 04:20:02 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id EBAD532009BB; Thu, 26 May 2022 00:19:50 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Thu, 26 May 2022 00:19:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1653538790; x= 1653625190; bh=yxxpkIoA1kY90kX63Tlbh10h2JP3Vo2biOZsFWXY7Nc=; b=o ugluLRlHMC114uXv2868rZvz6bs/5hZM5cp5xnn9R+EBZUmC+TmGfvNUXuWXzVgu sj/+VOQO84AMNWka/ZrRfDFsEmOi12zIFCDyT1EKQ89TWDxyv8Kdad8aY3xsXmm+ m10NmxnU5vy/iqW5chmsTVGt5WrnjQOT/hGcpSfY2gQziXif42ZjH0PaM6wLVCRw C8evT939DOecpj1aYBUEPCP7qBytS1HSaOniyqyFj/hQW924GOf3vPeNJ6M1ly3A WivdxEdAVbAP1O6FqzBK/ZCnXzVuIUTH6tbguPqWyhzTfOD3R0AVOpbJfE2oiH64 CWgHTFc7G6MzLa3d/UzhQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:feedback-id:feedback-id:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1653538790; x=1653625190; bh=y xxpkIoA1kY90kX63Tlbh10h2JP3Vo2biOZsFWXY7Nc=; b=kla+kThuantEv6MPA Xqc3ykkp5DGY0zw6K16oAbU2PtlubEIytKOxf2DF4Tf5Q+DG05ZpLAlL0iHVIgqM U2GfYCnWg5dphWM7k1Iu84O1OY7Agu15SW+Ev4Gq7SpJDxvkVR4FWfhVo4+JbF3U NlDLBagoZWqgOvcg4cE/eFPoqsa8YNrZQS8fUId9ka+OhVeyr13rSr1xtxu6m7JX 4ST6FVEOq7r4JbLrOy9+JtctJjWqLWpSsdFT9shaq6CnVApYZRJFuJI+wMHeICum GYmaUB1Te03xZ+7AkR1se4XVsmxWjkyEov2LfTlei+mJ8m12E78B3TJZiobu6r7s I+WQQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrjeeigdektdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepkfffgggfuffvfhfhjggtgfesthekre dttdefjeenucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhl rghvvghrsegrkhhlrghvvghrrdgtohhmqeenucggtffrrghtthgvrhhnpedugfeuleegve ffhfegleejhefhtedtgeeileeggfehfefffeevgeejtdeutefftdenucevlhhushhtvghr ufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvg hrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 26 May 2022 00:19:49 -0400 (EDT) Message-ID: <78550fd9-b26e-3827-b95c-b68f88938916@aklaver.com> Date: Wed, 25 May 2022 21:19:48 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: Automatic PK values not added to new rows Content-Language: en-US To: Ron , pgsql-general@lists.postgresql.org References: <4d12ca7-2188-f11e-9b2d-2098e2acfcf@appl-ecosys.com> From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 5/25/22 20:10, Ron wrote: > On 5/25/22 13:17, Rich Shepard wrote: >> On Wed, 25 May 2022, David G. Johnston wrote: >> >>> The value the sequence provides next is wholly independent of everything >>> except the state of the sequence. It doesn’t care how many rows any >>> table, >>> even its owner, has. The very existence of the delete command should >>> make >>> this self-evident. >> >> David J., >> >> I didn't know that. > > people_person_nbr_seq would have to somehow peek into public.people and > automatically update itself.  I'd be hopping mad if Postgresql did that > after I explicitly set the value of people_person_nbr_seq to the value > of my choosing, as if Postgresql knows better than I do what I want the > next value of people_person_nbr_seq to be. Though to be honest if you are setting up an automatic id system, be it serial or identity, and then overriding it with your own values you are looking for issues. Either let the system do it's thing and be an out of site out of mind number generator or take full control of the id generation yourself. -- Adrian Klaver adrian.klaver@aklaver.com