Re: Protocol buffer support for Postgres - Mailing list pgsql-hackers

From Craig Ringer
Subject Re: Protocol buffer support for Postgres
Date
Msg-id CAMsr+YHvkocjUehJ-=nTdx4cbuq3p0pr3=4-gNoatnJ4BAGFuA@mail.gmail.com
Whole thread Raw
In response to Protocol buffer support for Postgres  (陈天舟 <tianzhouchen@gmail.com>)
Responses Re: Protocol buffer support for Postgres  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 26 April 2016 at 14:06, 陈天舟 <tianzhouchen@gmail.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

pgsql-hackers by date:

Previous
From: 陈天舟
Date:
Subject: Protocol buffer support for Postgres
Next
From: Noah Misch
Date:
Subject: Re: pg_dump dump catalog ACLs