Dang. +1 for that.
Not that you hadn’t thought of it, and not that it’s actually a viable solution in a jiffy, but switch that mess to JSONB and your problems are over.