상황

ON CONFLICT ~ DO UPDATE ~ 수행 시 다음과 같은 에러 출력

더보기

there is no unique or exclusion constraint matching the ON CONFLICT specification

원인

Primary Key, Unique Key가 정의 되어 있지 않아 발생

해결

Unique Key 추가

ALTER TABLE [MY_TABLE]
ADD CONSTRAINT unique_datetime_tag_name UNIQUE (datetime, tag_name);Copy Icon
욱근욱
욱근욱
욱근욱