Unable to restore/update discourse (PG::InvalidTextRepresentation: ERROR: invalid input syntax for type integer: "[]")

Our ‘list’ settings are a thin UI over pipe-delimited strings, so in theory an empty list should be stored as an empty string. But you make a good point - maybe someone was trying to empty the list and did something like this by accident:

pry(main)> SiteSetting.selectable_avatars = []
=> []
pry(main)> SiteSetting.selectable_avatars
=> "[]"

(this is with the old format. The new format has validations to prevent this, even on the console)