小编Kyl*_*e K的帖子

为Postgres整数数组添加值

我在添加值寻求帮助10int[]PostgreSQL中9.5.

查看文档我应该能够使用这种格式来更新它,但它不起作用:

int[] + int   push element onto array (add it to end of array)
Run Code Online (Sandbox Code Playgroud)

我试过运行这个:

update table1 set integer_array = integer_array + 10::Integer. 
Run Code Online (Sandbox Code Playgroud)

它没有用,我收到了这个错误:

ERROR: operator does not exist: integer[] + integer
  Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.
  Position: 67
Run Code Online (Sandbox Code Playgroud)

我觉得这与文档中提供的有关如何执行此操作的格式相同.

arrays postgresql postgresql-9.5

7
推荐指数
4
解决办法
9778
查看次数

标签 统计

arrays ×1

postgresql ×1

postgresql-9.5 ×1