Skip to content
Advertisement

Upsert on an array column

I am trying to do an upsert on the array column but I am not able to achieve the following result.

Table name settings

After running the above query when I check the result

I am losing my old values. Also, the new values are getting inserted twice. Can anyone help me with this

Note: array_append won’t work because it appends only one item at a time whereas I need to append an array

Advertisement

Answer

You can use || to append one array to another:

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement