I가 다음 쿼리 :CASE를 사용하여 NULL 필드를 설정할 때 PostgreSQL이 타입에 대해 불평을하는 이유는 무엇입니까?
ERROR: column "own_license_expires_at" is of type timestamp without time zone but expression is of type text
LINE 1: update managed_avs set own_license_expires_at = CASE id WHEN...
^
HINT: You will need to rewrite or cast the expression.
이 왜 CASE id WHEN 50 THEN NULL END
유형의 텍스트의 것을 말하는가 : 나는 다음과 같은 오류가
UPDATE managed_avs
SET own_license_expires_at = CASE id WHEN 50 THEN NULL END
WHERE id in (50)
? 그냥 NULL
이 아닌가요?
왜 처음에는'case'를 사용합니까? 전체 문장은'update managed_avs SET own_license_expires_at = null id = 50'과 동일합니다. –
@a_horse_with_no_name 그래도 이런 일이 일어나고있는 것은 흥미 롭습니다. 설명이 있습니까? 'timestamp'는 Postgres AFAIK에서 nullable입니다. –
@a_horse_with_no_name이 쿼리는 생성되어 여러 행을 업데이트하기위한 것입니다. 나는 여기서 단순화 된 예제를 제공했다. –