Hello!
When try bulk update uuid field then peewee generate next SQL (PostgreSQL 15.0)
_taskid and _"video_forprocessing"."id" are UUID
UPDATE "video_for_processing"
SET "task_id" = CASE "video_for_processing"."id"
WHEN '7ce80e1f6318489c9bfff95277085cc9' THEN 'c6e12b50128e492095529b31d4132248'
WHEN 'c653225430fb4de28ef7b6901ee0253d' THEN '1f9998836f2047799d8081427a5b4cf1'
WHEN 'ff3ef6a1fc9e418f97556af4f238724f' THEN 'a6b427c97aa341a4b09bf22bb6e1de70'
END
WHERE ("video_for_pro
PostgreSQL throws exception:
ERROR: column "task_id" is of type uuid but expression is of type text
If wrap case statement to uuid(CASE ...) then it executes successfully
Example:
UPDATE "video_for_processing"
SET "task_id" = uuid(CASE "video_for_processing"."id"
WHEN '7ce80e1f6318489c9bfff95277085cc9' THEN 'c6e12b50128e492095529b31d4132248'
WHEN 'c653225430fb4de28ef7b6901ee0253d' THEN '1f9998836f2047799d8081427a5b4cf1'
WHEN 'ff3ef6a1fc9e418f97556af4f238724f' THEN 'a6b427c97aa341a4b09bf22bb6e1de70'
END)
WHERE ("video_for_processing"."id" IN ('7ce80e1f6318489c9bfff95277085cc9', 'c653225430fb4de28ef7b6901ee0253d', 'ff3ef6a1fc9e418f97556af4f238724f'))
Hello! When try bulk update uuid field then peewee generate next SQL (PostgreSQL 15.0)
_taskid and _"video_forprocessing"."id" are UUID
PostgreSQL throws exception:
If wrap case statement to uuid(CASE ...) then it executes successfully
Example: