我将来自 c 的字符串作为“{1,2,3,4,5}”传递,并尝试使用它来更新表中的数组 int[] 记录作为 format("UPDATE table SET array = %s WHERE *** ",string)
但是报错
"lastError = 0x009f0bda "ERROR: column "houses_list" is of type integer[] but expression is of type text"
请给出pgsql,tks中update array use string的正确格式
最佳答案
您可以尝试 '{1,2,3,4,5}'::int[]
或 ARRAY[1,2,3,4,5]
.
关于c++ - 如何在postgresql中格式化数组参数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9292651/