Bulk update in postgreSQL using unnest
问题 I am trying to do bulk update: > update ti_table set enabled=T.enabled from (select * from unnest(array['2001622', '2001624', '2007903']) as id, unnest(array[15,14,8]) as ver, unnest(array['type1', 'type1', 'type1']) as type, unnest(array[false, true, true]) as enabled) T where ti_table.id=T.id AND ti_table.ver=T.ver AND ti_table.type=T.type; However, when I read back: > select id, ver, type, enabled from ti_table where id in ('2001622', '2001624', '2007903'); I see: id | ver | type | enabled