Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- Pagination Optimization
- 페이지네이션 최적화
- Query String
- 문자열 검증
- kafkaconnect
- 1450
- kafka-connect
- foreign key constraint fails
- jdbc connector
- debezium
- 참조무결성
- Invalid character found in method name
- Path Variable
- API 설계
- kafka connect
- Late row lookup
- 제약 조건
- Cannot add or update a child row: a foreign key constraint fails
- Cannot delete or update a parent row: a foreign key constraint fails
- event loop
- 페이지네이션
- programmers
- git rebase -i
- reflog
- code --no-sandbox
- constraint fails
- 23000
- 1452
- git reflog
- Git
Archives
- Today
- Total
Kawaii_Jordy
[참조무결성] (1452): Cannot add or update a child row: a foreign key constraint fails 해결 본문
취준/DB
[참조무결성] (1452): Cannot add or update a child row: a foreign key constraint fails 해결
Kawaii_Jordy 2021. 5. 8. 13:31Problem
(1452): Cannot add or update a child row: a foreign key constraint fails
Foreign key에 값을 삽입할 때, 참조하는 테이블의 Primary key에 해당하는 값만 삽입해야 하지만 이를 어길 시 위의 에러가 발생한다.
Solution
참조하는 테이블의 Primary key에 값을 넣어준 뒤, 참조 받는 테이블의 Foreign key의 값을 참조하는 테이블의 Primary key의 값으로 넣어준다.
'취준 > DB' 카테고리의 다른 글
[Mysql, Maria] TIMEDIFF with option (0) | 2021.06.03 |
---|---|
[Sequelize] bind (0) | 2021.06.02 |
[Sequelize] transaction (0) | 2021.05.26 |
[Sequlize] nodejs sequelize raw-queries (0) | 2021.05.12 |
[Pagination] limit, offset 사용법 및 Late Row Lookup을 통한 Pagination 최적화 (0) | 2021.05.10 |
Comments