一括更新をしようとしています:
> 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;
しかし、読み返すと:
> select id, ver, type, enabled from ti_table where id in ('2001622', '2001624', '2007903');
そうですか:
id | ver | type | enabled
---------+-----+-------+---------
2001622 | 15 | type1 | f
2001624 | 14 | type1 | f
2007903 | 8 | type1 | f
最後の2行で有効になっているのはfalse
、私が期待していたときですtrue
なぜこれが起こっているのですか?どうすれば正しく行うことができますか?
ありがとう。