Update multiple rows with one query in postgresql

postgresql
CREATE TABLE table1 ( 
	"id" Integer NOT NULL,
	"a" Text NOT NULL,
	"b" Text NOT NULL );
insert into table1 values  
(1, 'a', 'b'),
(2, 'a', 'b')
update table1 as t set 
  a = data.a,
  b = data.b
from (values
  (1, 'a1', 'b1'),
  (2, 'a2', 'b2')
) as data(id, a, b)
where t.id = data.id