Add an element to an array column.
Section: JSONB, Arrays, and Date/Time Recipes
Append to array
sql
sql
UPDATE user_profiles SET tags = array_append(tags, 'vip') WHERE user_id = 42;Explanation
See summary for usage details.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing JSONB, Arrays, and Date/Time Recipes