Hey, im trying to update multiple rows with a real[] column.
My approach is this:
const data = [[123, [1.2,3.4,5.6]], ... ]
UPDATE mytable as t
SET myreal = (v.myreal)::real[]
FROM (VALUES ${sql(data)}) AS v(id, myreal)
WHERE t.id = (v.id)::int
This throws a PG error: malformed array literal: "1.2,3.4,5.6". This leads me to believe that I cannot hand an array in like this as it is being cast to a string and sent directly. I found a workaround using const data = [[123, '{'+[1.2,3.4,5.6].join(',')+'}'], ... ].
Hey, im trying to update multiple rows with a real[] column.
My approach is this:
const data = [[123, [1.2,3.4,5.6]], ... ]
This throws a PG error:
malformed array literal: "1.2,3.4,5.6"
. This leads me to believe that I cannot hand an array in like this as it is being cast to a string and sent directly. I found a workaround usingconst data = [[123, '{'+[1.2,3.4,5.6].join(',')+'}'], ... ]
.Am I doing something wrong?