Re: duplicate key value violates unique constraint

Поиск
Список
Период
Сортировка
От Ron
Тема Re: duplicate key value violates unique constraint
Дата
Msg-id e4c5d934-038b-735b-ba53-88844ae7ed15@gmail.com
обсуждение исходный текст
Ответ на duplicate key value violates unique constraint  (Ashkar Dev <ashkardev@gmail.com>)
Список pgsql-general

Asking the same question on multiple lists is strongly frowned upon.

On 3/7/20 1:29 PM, Ashkar Dev wrote:
Hi all,

how to fix a problem, suppose there is a table with id and username

if I set the id to bigint so the limit is 9223372036854775807 
if I insert for example 3 rows
id    username
--    --------------
1     abc
2     def
3     ghi

if I delete all rows and insert one another it is like

id    username
--    --------------
4     jkl


So it doesn't start again from non-available id 1, so what is needed to do to make the new inserts go into non-available id numbers?

--
Angular momentum makes the world go 'round.

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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: duplicate key value violates unique constraint
Следующее
От: Tiffany Thang
Дата:
Сообщение: Re: Restrict user to create only one db with a specific name