Search Postgresql Archives

Automatic PK values not added to new rows

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

 



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





[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