On Fri, 2012-05-04 at 13:43 -0400, Robert Haas wrote: > On Fri, May 4, 2012 at 12:56 PM, Tom Lane <t...@sss.pgh.pa.us> wrote: > > Andrew Dunstan <and...@dunslane.net> writes: > >> Yeah, what I've been thinking about in conjunction with similar problems > >> is some sort of type registry, so that we could code for non-builtin > >> types in certain cases. Maybe we should add that the the developers' > >> meeting agenda. > > > > Maybe. I don't want to see a json-specific hack for this, but some sort > > of generic way to add type knowledge could be useful, if we could figure > > out what we want. > > For this particular case, I think you just need some place to store a > pg_type -> pg_proc mapping. I'm not exactly sure how to make that not > a JSON-specific hack, since I certainly don't think we'd want to add a > new catalog just for that.
This was my initial proposal to have casts to ::json for all types. I backed out from this in favot of generic to_json(datum, indent) in order to support prettyprinting. > -- > Robert Haas > EnterpriseDB: http://www.enterprisedb.com > The Enterprise PostgreSQL Company > -- Sent via pgsql-hackers mailing list (email@example.com) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers