Hi guys, As mentioned in the last email that the current interface is based on bytea. To make users easily insert any thrift data structure and show them, we may want to have user friendly (user readable) format for this plugin. I can think about 2 ways to do this. One is to provide to_thrift(json object) and to_json(thrift object) interfaces in the plugin. And the format in database table is still bytea. So, when you want to insert data into the table, users provide json/jsonb object, then call to_thrift() to covert to thrift bytes. When one want to read table content, using to_json() to covert thrift bytes to json. The second is to provide thrift type just like json or jsonb. When you create a table, postgres knows ::thrift keywords. I think method one should be easier to implement because it only limits to this plugin. Method two needs modify postgres kernel to register a new type, which may time consuming, but more natural. Any ideas on this?
Thanks, Charles 2018-05-21 21:27 GMT-07:00 Charles Cui <charles.cui1...@gmail.com>: > Hi mentors and hackers, > > I have set up a github repo for the pg thrift plugin work, and here is > the address (https://github.com/charles-cui/pg_thrift). And I have first > version of binary protocol implemented, although it is still a very early > stage. The current interface is to return value for simple data > structure(byte, string, int32, int16, int64, bool) and return raw bytes for > complex data structure(list, map, set, struct). As suggested by Aleksander, > I can add json interfaces to use this plugin easily. Let me know if you > guys have any comments on this. > > Thanks, Charles. >