Re: duplicate key violates unique constraint
От | Alban Hertroys |
---|---|
Тема | Re: duplicate key violates unique constraint |
Дата | |
Msg-id | 450FB4F2.7000308@magproductions.nl обсуждение исходный текст |
Ответ на | Re: duplicate key violates unique constraint (Ron Johnson <ron.l.johnson@cox.net>) |
Список | pgsql-general |
Ron Johnson wrote: > # select * from projects; > project_id | username | project_name > - ------------+----------+-------------- > 1 | foo | > 2 | bar | > (2 rows) > > dupe_filenames=# insert into projects (project_name, username ) > dupe_filenames-# values ('foo', 'bar'); > ERROR: duplicate key violates unique constraint "projects_pkey" And you didn't insert records with those numbers by hand (not using the sequence)? It seems your sequence is a bit behind, which only happens if you don't always use it to generate your ids. I suggest you check your sequence values and update it to the highest value in use if it's too low. You should only need to do that once. -- Alban Hertroys alban@magproductions.nl magproductions b.v. T: ++31(0)534346874 F: ++31(0)534346876 M: I: www.magproductions.nl A: Postbus 416 7500 AK Enschede // Integrate Your World //
В списке pgsql-general по дате отправления: