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

I had a similar error on my test site where I had some errant data in my selectable_avatar site setting, and had to update it through the rails console.

Are you comfortable using the rails console? If so, could you run this and see what it says:

SiteSetting.where(data_type:17)