Re: [GSoC] github repo and initial work

From: Charles Cui <charles(dot)cui1984(at)gmail(dot)com>
To: Aleksander Alekseev <a(dot)alekseev(at)postgrespro(dot)ru>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Anastasia Lubennikova <a(dot)lubennikova(at)postgrespro(dot)ru>, Andrey Borodin <x4mmm(at)yandex-team(dot)ru>
Subject: Re: [GSoC] github repo and initial work
Date: 2018-05-25 01:25:28
Message-ID: CA+SXE9srHROr-CmvpeMKZMNs5fUvTqq6b-5bAbRmGW7J0DvgOw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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(dot)cui1984(at)gmail(dot)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.
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2018-05-25 01:38:38 Add PostgreSQL 11 to feature matrix page?
Previous Message Kyotaro HORIGUCHI 2018-05-25 01:05:14 Re: A Japanese-unfriendy error message contruction