Re: Gaps in PK sequence numbers [RESOLVED]

Поиск
Список
Период
Сортировка
От Rich Shepard
Тема Re: Gaps in PK sequence numbers [RESOLVED]
Дата
Msg-id 92fc77dd-8b98-2810-107b-aac4795191d5@appl-ecosys.com
обсуждение исходный текст
Ответ на Re: Gaps in PK sequence numbers [RESOLVED]  (Christophe Pettus <xof@thebuild.com>)
Список pgsql-general
On Mon, 10 Jun 2024, Christophe Pettus wrote:

> The sequence functions are documented here:
>     https://www.postgresql.org/docs/current/functions-sequence.html
> setval is the function you want. You can use a SELECT so you don't have to
> copy values around:
>     select setval('t_pk_seq', (select max(pk) from t));
> That form of setval() sets the sequence so that the next value will be one
> more than the value you set it to, so you don't have to do max()+1 there.

Thanks again, Christophe.

Regards,

Rich




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

Предыдущее
От: hubert depesz lubaczewski
Дата:
Сообщение: Re: Does trigger only accept functions?
Следующее
От: Dominique Devienne
Дата:
Сообщение: Unexpected Backend PID reported by Notification