From: | Craig Ringer <craig(at)2ndquadrant(dot)com> |
---|---|
To: | 陈天舟 <tianzhouchen(at)gmail(dot)com> |
Cc: | PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Protocol buffer support for Postgres |
Date: | 2016-04-26 06:23:51 |
Message-ID: | CAMsr+YHvkocjUehJ-=nTdx4cbuq3p0pr3=4-gNoatnJ4BAGFuA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On 26 April 2016 at 14:06, 陈天舟 <tianzhouchen(at)gmail(dot)com> wrote:
> I am interested in adding Protocol Buffer support for Postgres. Protocol
> Buffer occupies less space than JSON. More importantly, it has schema and
> is forward/backward compatible. All these make it a very good format for
> persistency.
>
> Here are two rough ideas I have right now:
>
> Approach 1:
>
> Creating a datatype "PROTOBUF" similar as "JSON" and implement all the
> similar support (e.g. indexing) as done for "JSON" Type.
> (1) Since each protocol buffer column requires a schema. I am not sure
> where is the best place to store that schema info. Should it be in a
> CONSTRAINT (but I am not able to find the doc referring any custom
> constraint), or should it be in the COMMENT or somewhere else?
>
I can't really imagine how you'd do that without adding a new catalog like
we have for enum members. A typmod isn't sufficient since you need a whole
lot more than an integer, and typmods aren't tracked throughout the server
that well.
That'll make it hard to do it with an extension.
--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
From | Date | Subject | |
---|---|---|---|
Next Message | Noah Misch | 2016-04-26 06:38:22 | Re: pg_dump dump catalog ACLs |
Previous Message | 陈天舟 | 2016-04-26 06:06:11 | Protocol buffer support for Postgres |