Re: Automatic PK values not added to new rows

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Automatic PK values not added to new rows
Дата
Msg-id CAKFQuwZeb8y-p9kXzPhACZVGZYXjKvz22B+Tk7H3w+d20HTA3Q@mail.gmail.com
обсуждение исходный текст
Ответ на Automatic PK values not added to new rows  (Rich Shepard <rshepard@appl-ecosys.com>)
Ответы Re: Automatic PK values not added to new rows  (Rich Shepard <rshepard@appl-ecosys.com>)
Список pgsql-general
On Wednesday, May 25, 2022, Rich Shepard <rshepard@appl-ecosys.com> wrote:

I'm trying to insert 15 new rows to that table by inserting all columns
except the first one..

That…
 

person_nbr 683 is not in any row to be inserted.

Implies that.
 

I was under the impression that the person_nbr for the new rows would start
with 966 but that's apparently not happening.

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.

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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Automatic PK values not added to new rows
Следующее
От: Bryn Llewellyn
Дата:
Сообщение: Re: "Join Postgres on Slack" ?