I need to UPDATE existing rows with numeric arrays. I'm stuck on the syntax in regards to quotes (I think) currently. Here are the queries I have tried...
Test 1
WITH update_table_1 (id,column_b) AS
(VALUES (1,'{22}'), (72,'{29, 5}'))
UPDATE table_1 SET id = up.id, column_b = up.column_b FROM update_table_1 up
WHERE up.id = table_1.id;
Test 2
WITH update_table_1 (id,column_b) AS
(VALUES (1,'{"22"}'), (72,'{"29","5"}'))
UPDATE table_1 SET id = up.id, column_b = up.column_b FROM update_table_1 up
WHERE up.id = table_1.id;
Test 3
WITH update_table_1 (id,column_b) AS
(VALUES (1,{22}), (72,{29, 5}))
UPDATE table_1 SET id = up.id, column_b = up.column_b FROM update_table_1 up
WHERE up.id = table_1.id;
Test 4
WITH update_table_1 (id,column_b) AS
(VALUES (1,{22}), (72,{"29","5"}))
UPDATE table_1 SET id = up.id, column_b = up.column_b FROM update_table_1 up
WHERE up.id = table_1.id;
'{1,2}'::bigint[]