What would be the proper syntax used to run an update query on a table to remove all spaces from the values in a column?
My table is called users and in
users
If it's a text[] column, you can do something like this:
text[]
UPDATE users SET pets = string_to_array(replace(array_to_string(pets, ';'), ' ', ''), ';');
Before: {"Big Dog", "Small Cat"}
{"Big Dog", "Small Cat"}
After: {"BigDog", "SmallCat"}
{"BigDog", "SmallCat"}