Re: Reset sequence to current maximum value of rows - Mailing list pgsql-general

From David G. Johnston
Subject Re: Reset sequence to current maximum value of rows
Date
Msg-id CAKFQuwb-msDns_5FNvpakoW1GNksejZPApMw05eNQtuwnQiMYw@mail.gmail.com
Whole thread Raw
In response to Re: Reset sequence to current maximum value of rows  (Rich Shepard <rshepard@appl-ecosys.com>)
Responses Re: Reset sequence to current maximum value of rows [RESOLVED]
List pgsql-general
On Thu, Jun 13, 2024 at 12:57 PM Rich Shepard <rshepard@appl-ecosys.com> wrote:
INSERT into companies (company_nbr,company_name,industry,status) VALUES
(DEFAULT,'A new company name', 'Manufacturing',DEFAULT);

Yesterday, before learning to use DEFAULT for the company_nbr PK I entered
all rows using company_nbr 2342-2391. This morning, after running the
single-line INSERT command company numbers from 2341-2392 all had 'A new
company name' as the company_name.


There is no way, in the absence of a user trigger, that the above insert command changed pre-existing rows.  And if you cannot reproduce the behavior you claim to have seen I will continue to just assume you have faulty memory.

David J.

pgsql-general by date:

Previous
From: Rich Shepard
Date:
Subject: Re: Reset sequence to current maximum value of rows
Next
From: Casey & Gina
Date:
Subject: Re: Question about UNIX socket connections and SSL