Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iPWIs-0005Nc-DP for pgsql-general@arkaria.postgresql.org; Tue, 29 Oct 2019 18:33:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iPWIq-0000NC-1h for pgsql-general@arkaria.postgresql.org; Tue, 29 Oct 2019 18:33:12 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iPWIp-0000N5-LB for pgsql-general@lists.postgresql.org; Tue, 29 Oct 2019 18:33:11 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iPWIj-0008G8-5j for pgsql-general@lists.postgresql.org; Tue, 29 Oct 2019 18:33:10 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x9TIX0a9031568; Tue, 29 Oct 2019 14:33:00 -0400 From: Tom Lane To: Mitar cc: f.venchiarutti@ocado.com, Dave Cramer , "pgsql-generallists.postgresql.org" Subject: Re: Automatically parsing in-line composite types In-reply-to: References: Comments: In-reply-to Mitar message dated "Tue, 29 Oct 2019 10:58:22 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <31566.1572373980.1@sss.pgh.pa.us> Date: Tue, 29 Oct 2019 14:33:00 -0400 Message-ID: <31567.1572373980@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Mitar 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