Duplicate key value violates unique constraint "shedlock_pkey"
See original GitHub issueHello,
when application starts we have following error on PostgreSQL logs:
ERROR: duplicate key value violates unique constraint "shedlock_pkey"
DETAIL: Key (name)=(SomeScheduler) already exists.
STATEMENT: INSERT INTO shedlock(name, lock_until, locked_at, locked_by) VALUES($1, $2, $3, $4)
Is there a possibility to avoid or fix above error?
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
postgresql duplicate key violates unique constraint
If the first value is higher than the second value, your sequence is out of sync. Back up your PG database (just in...
Read more >Handling duplicate key value violates unique constraint error
Hey! When trying to register with an email that exists in the database I'm getting the following error: SQLSTATE[23505]: Unique violation: 7 ERROR: ......
Read more >How to solve "duplicate key value violates unique constraint ...
The import of a configuration into an existing organisation failed.
Read more >Bug #15729: duplicate key value violates unique constraint ...
Description. ERROR: duplicate key value violates unique constraint "dynflow_coordinator_records_pkey" DETAIL: Key (id, class)=(delayed-executor, ...
Read more >Why am I getting ERROR: duplicate key value violates unique ...
You cannot have duplicate keys on primary key column i.e movie_num=20 Change Movie Die Another Day with movie_num =20 to 24
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I am using the JDBC template provider -Oracle. On every restart of service, we are getting duplicate key value “violates unique constraint” Exception. It seems a bit annoying to me and was looking for a resolution by extending the JdbcTemplateStorageAccessor but failed to do so. Is there a possibility to avoid this exception in logs?
@lukas-krecan I hope I sent the PR properly, can you please check once?
PR - #1155