Re: Automatically parsing in-line composite types

From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: Mitar <mmitar(at)gmail(dot)com>
Cc: "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Automatically parsing in-line composite types
Date: 2019-10-29 12:23:39
Message-ID: CADK3HHKbTx2yLwikjcjaZ_Qfm1-ZWh=U=uH-pc14vDp-j7NUzw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 23 Oct 2019 at 15:50, Mitar <mmitar(at)gmail(dot)com> wrote:

> Hi!
>
> Bump my previous question. I find it surprising that it seems this
> information is not possible to be reconstructed by the client, when
> the server has to have it internally. Is this a new feature request or
> am I missing something?
>
> > I am trying to understand how could I automatically parse an in-line
> > composite type. By in-line composite type I mean a type corresponding
> > to ROW. For example, in the following query:
> >
> > SELECT _id, body, (SELECT array_agg(ROW(comments._id, comments.body))
> > FROM comments WHERE comments.post_id=posts._id) AS comments FROM posts
> >
> > It looks like I can figure out that "comments" is an array of records.
> > But then there is no way really to understand how to parse those
> > records? So what are types of fields in the record?
> >
> > I start the parsing process by looking at types returned in
> > RowDescription message and then reading descriptions in pg_type table.
> >
> > Is there some other way to get full typing information of the result I
> > am assuming is available to PostreSQL internally?
>
>
>
Reading the RowDescription is the only way I am aware of.

Dave Cramer

davec(at)postgresintl(dot)com
www.postgresintl.com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Fabio Ugo Venchiarutti 2019-10-29 16:06:24 Re: Automatically parsing in-line composite types
Previous Message Thomas Munro 2019-10-29 11:13:49 Re: PostgreSQL - unrecognized win32 error code: 38