Fwd: duplicate key value violates unique constraint

Поиск
Список
Период
Сортировка
От Ashkar Dev
Тема Fwd: duplicate key value violates unique constraint
Дата
Msg-id CAHaowgUOCnKehQERBF0qN5gVnghbvr8AefdHhg3X9Aiu0vCaEw@mail.gmail.com
обсуждение исходный текст
Ответы RE: duplicate key value violates unique constraint  ("Dave Bolt" <dave@davebolt.co.uk>)
Re: duplicate key value violates unique constraint  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-admin

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?

and if the id reaches the limit and maybe there is some ids that are not used.

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

Предыдущее
От: Scott Ribe
Дата:
Сообщение: Re: shm
Следующее
От: "Dave Bolt"
Дата:
Сообщение: RE: duplicate key value violates unique constraint