I don't know what you are using as a front end to call this update, but I have been finding json/jsonb parameters passed into a function / procedure and then using postgres json functions to process the data as a good solution.
If your data fits postgres array datatype, as others have mentioned, that is also a good (and possibly simpler) solution.
This function fail to update the old record, but success to insert the new record.
Please help me how to fixed this problem. I know the problem is the update command, but i don't know the correct it. Googling anywhere didn't find any solution.