C++ 如何在pgsql中格式化数组参数?
我将c中的一个字符串作为“{1,2,3,4,5}”传递,并尝试使用它将表中的数组int[]记录更新为C++ 如何在pgsql中格式化数组参数?,c++,arrays,postgresql,C++,Arrays,Postgresql,我将c中的一个字符串作为“{1,2,3,4,5}”传递,并尝试使用它将表中的数组int[]记录更新为格式(“更新表集数组=%s,其中***”,字符串) 但是,我得到了错误 "lastError = 0x009f0bda "ERROR: column "houses_list" is of type integer[] but expression is of type text" “lastError=0x009f0bda”错误:“houses_list”列的类型为integer[],但表达式
格式(“更新表集数组=%s,其中***”,字符串)
但是,我得到了错误
"lastError = 0x009f0bda "ERROR: column "houses_list" is of type integer[] but expression is of type text"
“lastError=0x009f0bda”错误:“houses_list”列的类型为integer[],但表达式的类型为text”
请在pgsql、tks中提供更新数组使用字符串的正确格式。您可以尝试
'{1,2,3,4,5}'::int[]
或数组[1,2,3,4,5]