pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Mitar <mmitar@gmail.com>
Cc: f.venchiarutti@ocado.com
Cc: Dave Cramer <pg@fastcrypt.com>
Cc: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: Automatically parsing in-line composite types
Date: Tue, 29 Oct 2019 14:33:00 -0400
Message-ID: <31567.1572373980@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKLmikP4b8H9tCVOptxUAfgDZ=jEOaGe59r861gjaX80tY1asw@mail.gmail.com>
References: <CAKLmikMrm778-eETLvVAd1W_u0R8TB+suAFO6jhMTmXQg3yhGg@mail.gmail.com>
	<CAKLmikPK_XeWT978gpozHsMFQ+JURqJsUmDGpC2gLt1sOdvmcw@mail.gmail.com>
	<CADK3HHKbTx2yLwikjcjaZ_Qfm1-ZWh=U=uH-pc14vDp-j7NUzw@mail.gmail.com>
	<e72efb14-4015-5820-850b-8b8ae14de7bd@ocado.com>
	<CAKLmikP4b8H9tCVOptxUAfgDZ=jEOaGe59r861gjaX80tY1asw@mail.gmail.com>

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





view thread (17+ messages)  latest in thread

Message-ID: <31567.1572373980@sss.pgh.pa.us>
Permalink:  ../31567.1572373980@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/31567.1572373980@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, mmitar@gmail.com, f.venchiarutti@ocado.com, pg@fastcrypt.com
  Subject: Re: Automatically parsing in-line composite types
  In-Reply-To: <31567.1572373980@sss.pgh.pa.us>
  References: <CAKLmikMrm778-eETLvVAd1W_u0R8TB+suAFO6jhMTmXQg3yhGg@mail.gmail.com> <CAKLmikPK_XeWT978gpozHsMFQ+JURqJsUmDGpC2gLt1sOdvmcw@mail.gmail.com> <CADK3HHKbTx2yLwikjcjaZ_Qfm1-ZWh=U=uH-pc14vDp-j7NUzw@mail.gmail.com> <e72efb14-4015-5820-850b-8b8ae14de7bd@ocado.com> <CAKLmikP4b8H9tCVOptxUAfgDZ=jEOaGe59r861gjaX80tY1asw@mail.gmail.com> <31567.1572373980@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox