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 1ntv2W-00062R-Dn for pgsql-general@arkaria.postgresql.org; Wed, 25 May 2022 17:43:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ntv2V-0004Oy-4D for pgsql-general@arkaria.postgresql.org; Wed, 25 May 2022 17:43:19 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ntv2U-0004NK-Pp for pgsql-general@lists.postgresql.org; Wed, 25 May 2022 17:43:18 +0000 Received: from mail.appl-ecosys.com ([50.126.108.78]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ntv2S-0001rx-Ex for pgsql-general@lists.postgresql.org; Wed, 25 May 2022 17:43:17 +0000 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by mail.appl-ecosys.com (Postfix) with ESMTP id C40AD2A0107 for ; Wed, 25 May 2022 10:43:14 -0700 (PDT) Date: Wed, 25 May 2022 10:43:14 -0700 (PDT) From: Rich Shepard Reply-To: Rich Shepard To: pgsql-general@lists.postgresql.org Subject: Automatic PK values not added to new rows Message-ID: 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: Archived-At: Precedence: bulk The People table has 965 rows; the table structure is: Table "public.people" Column | Type | Collation | Nullable | Default ---------------+-----------------------+-----------+----------+------------------------------------- person_nbr | integer | | not null | nextval('people_person_nbr_seq'::reg class) lname | character varying(32) | | not null | '??'::character varying fname | character varying(15) | | not null | '??'::character varying job_title | character varying(48) | | | company_nbr | integer | | | loc_nbr | integer | | not null | 1 loc_phone_ext | character varying(32) | | | direct_phone | character varying(15) | | | direct_fax | character varying(15) | | | cell_phone | character varying(15) | | | email | character varying(64) | | | active | boolean | | not null | true comment | text | | | Indexes: "people_pkey" PRIMARY KEY, btree (person_nbr) Foreign-key constraints: "people_org_nbr_fkey" FOREIGN KEY (company_nbr) REFERENCES companies(company_nbr) ON UPDATE CASC ADE ON DELETE RESTRICT I'm trying to insert 15 new rows to that table by inserting all columns except the first one.. Psql tells me: psql:insert_into_people.sql:16: ERROR: duplicate key value violates unique constraint "people_pkey" DETAIL: Key (person_nbr)=(683) already exists. person_nbr 683 is not in any row to be inserted. I was under the impression that the person_nbr for the new rows would start with 966 but that's apparently not happening. What have I missed? Rich