Postgresql 9.2 has JSON objects, 9.4 introduces JSONB, but they are often more hassle than they are worth. See the Postgresql docs.
ActiveRecord can also serialize/deserialze hashs (or any other sort of Ruby non-primitive), but it's also often more hassle than it's worth. See http://api.rubyonrails.org/classes/ActiveRecord/AttributeMethods/Serialization/ClassMethods.html#method-i-serialize for the latter.
I'll very much second Colin's first point: more analysis and better understanding of the data structures generally give better results. (i.e., more testable, extendable, maintainable, to my mind)