Re: Reset sequence to current maximum value of rows

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Reset sequence to current maximum value of rows
Дата
Msg-id CAKFQuwY-E_EuCHO+Q1o2Lc1d0r-TUp9f18UWRx1TtMEsLzDHvA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Reset sequence to current maximum value of rows  (Rich Shepard <rshepard@appl-ecosys.com>)
Список pgsql-general
On Thu, Jun 13, 2024 at 3:13 PM Rich Shepard <rshepard@appl-ecosys.com> wrote:
Yes, I'm sure. Early yesterday I did get duplicate key errors. That's when I
looked on stackexchange to learn how to reset the sequence's max value to
the value of the number of rows in the table. Not only did my attempt to add
a single new company to the companies table change all company names in that
one industry to the new name, but I just discovered that it changed all rows
in that column to the new company name:


At present the belief there is a bug in PostgreSQL is unsubstantiated.

I suggest you look internally for how an update command that caused the resultant data could have been executed.  That is much more plausible, and thus a better use of time, if you want to spend more time on this, than trying to produce the observed behavior again using just insert and setval(...) commands.

David J.

В списке pgsql-general по дате отправления:

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Reset sequence to current maximum value of rows
Следующее
От: "Shenavai, Manuel"
Дата:
Сообщение: Configure autovacuum