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

From Tom Lane
Subject Re: Automatically parsing in-line composite types
Date
Msg-id 31567.1572373980@sss.pgh.pa.us
Whole thread Raw
In response to Re: Automatically parsing in-line composite types  (Mitar <mmitar@gmail.com>)
Responses Re: Automatically parsing in-line composite types
Re: Automatically parsing in-line composite types
List pgsql-general
Mitar <mmitar@gmail.com> writes:
> I think RowDescription should be extended to provide full recursive
> metadata about all data types. That would be the best way to do it.

[ shrug... ]  In a world where stability of the wire protocol were
of zero value, maybe we would do that.  In the real world, don't
hold your breath.

Note that dealing with composite values in full generality is by no
means just a problem of getting this metadata.  Clients would also
have to be prepared to parse and de-escape the data representation,
which is not trivial in either text or binary cases.

On the whole I think it's generally better practice to explode your
composite types into separate fields for transmission to the client.

Note that the cases where JSON or XML shine are where you don't
necessarily have a consistent set of fields in different instances
of the composite values.  Even if we did extend RowDescription to
support describing composites' sub-fields, it wouldn't be in
much of a position to deal with that.

            regards, tom lane



pgsql-general by date:

Previous
From: Mitar
Date:
Subject: Re: Automatically parsing in-line composite types
Next
From: Mitar
Date:
Subject: Re: Automatically parsing in-line composite types