[척척학사] 🚨 PostgreSQL: duplicate key value violates unique constraint 에러 해결하기
·
Project/척척학사
이 글은 Velog에서 이전한 글입니다. Velog 원문 보기척척학사 프로젝트를 진행하던 중 다음과 같은 에러가 발생했습니다.ERROR: duplicate key value violates unique constraint "student_courses_pkey"Detail: Key (id)=(1646) already exists.Transaction silently rolled back because it has been marked as rollback-only🔍 원인 분석제 프로젝트에서는 StudentCourse 엔티티가 다음과 같이 설정되어 있습니다.@Id@GeneratedValue(strategy = GenerationType.IDENTITY)private Long id;즉, id는 DB에서 자..