Open saolof opened 1 year ago
msgpack was discussed here before: https://github.com/PostgREST/postgrest/issues/1548
https://github.com/PostgREST/postgrest/pull/1582 is still looking like the way forward
Even with better content negotiation, we'd still need a way to convert to and from msgpack. Is there a postgres extension to do it?
Yes, there's https://github.com/patriksimek/msgpack-postgres
Yes, there's https://github.com/patriksimek/msgpack-postgres
Right, I'm just not sure whether an implementation written in plpgsql will be helpful in terms of performance... which seems to be the primary use-case for to request msgpack data in the first place.
Is this now possible from PostgREST-side? I think it is, right? @steve-chavez
Yeah, should be possible like:
create domain "application/x-msgpack" as bytea;
create or replace function hello() returns "application/x-msgpack" as $$
select msgpack_encode('{"hello": "world"}'::jsonb);
$$ language sql;
Using the extension https://github.com/patriksimek/msgpack-postgres.
Messagepack is a json-isomorphic binary serialization format that is becoming fairly widely supported and which supports fast streaming serialization/deserialization. It would be neat to have it as a return format. Both in JSON like form, and in a header + stream of tuples form for returning large numerical data sets like timeseries.