Re: Automatically parsing in-line composite types - Mailing list pgsql-general

From Mitar
Subject Re: Automatically parsing in-line composite types
Date
Msg-id CAKLmikO=yB5hGGvB6AdyQpzFH9h9L=2=1MoDshAUpEZ=TnqhiA@mail.gmail.com
Whole thread Raw
In response to Re: Automatically parsing in-line composite types  (Merlin Moncure <mmoncure@gmail.com>)
List pgsql-general
Hi!

On Wed, Oct 30, 2019 at 3:06 PM Merlin Moncure <mmoncure@gmail.com> wrote:
> It looks it up from the database.

Yes, this is how I started doing it in my prototype as well.

> Correct. Only declared (via CREATE TYPE) composite types will work due
> to protocol limitations.

Exactly. This is where I got stuck, so this is why I started this thread. :-(

> So if you decided to scratch in itch and create a postgres
> BSON type, no one would likely use it, since the chances of adoption
> in core are slim to none.

Yea. :-( So we get back to square one. :-(

One other approach I was investigating was developing a Babel-like
transpiler for PostgreSQL SQL, so that I could have plugins which
would convert SQL queries to automatically encode values in JSON. And
then parse it back out once results arrive. Because yes, as you note,
JSON is the only stable and supported format among all installations
there is (except for the wire format, which has limitations). So
having to map to it and back, but without developer having to think
about it, might be the best solution.


Mitar

-- 
http://mitar.tnode.com/
https://twitter.com/mitar_m



pgsql-general by date:

Previous
From: Kevin Brannen
Date:
Subject: RE: Upgrade procedure
Next
From: M Tarkeshwar Rao
Date:
Subject: RE: Getting following error in using cursor to fetch the records froma large table in c language