PostgreSQL JSON Append Error – No Operator Matches Given Types

jsonpostgresql

clusters_v2=# UPDATE cluster SET "clusterCALogs" = "clusterCALogs" || '["test"]'::jsonb WHERE "clusterId" = 9;
ERROR:  operator does not exist: json || jsonb
LINE 1: ...ATE cluster SET "clusterCALogs" = "clusterCALogs" || '["test...
                                                             ^
HINT:  No operator matches the given name and argument types. You might need to add explicit type casts.

According to https://stackoverflow.com/a/42233548/1663462 I should be able to append to the JSON array? Why am I getting this error?

Best Answer

My column type for "clusterCALogs" was json... It had to be jsonb.