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 1hMOO8-0007LU-Ac for pgsql-sql@arkaria.postgresql.org; Fri, 03 May 2019 02:57:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hMON6-0008Bn-UA for pgsql-sql@arkaria.postgresql.org; Fri, 03 May 2019 02:56:24 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hMON6-0008Bf-Lq for pgsql-sql@lists.postgresql.org; Fri, 03 May 2019 02:56:24 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hMON1-0006hA-Fc for pgsql-sql@lists.postgresql.org; Fri, 03 May 2019 02:56:23 +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 x432uEqn012206; Thu, 2 May 2019 22:56:14 -0400 From: Tom Lane To: Mark Teper cc: pgsql-sql@lists.postgresql.org Subject: Re: plpython transforms vs. arrays In-reply-to: References: Comments: In-reply-to Mark Teper message dated "Thu, 02 May 2019 13:51:22 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <12204.1556852174.1@sss.pgh.pa.us> Date: Thu, 02 May 2019 22:56:14 -0400 Message-ID: <12205.1556852174@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Mark Teper writes: > The problem is this produces an error that transforms for type "real" > doesn't work. It doesn't seem to allow for transforms on array's as > opposed to underlying types. Is it possible to tell it to apply the > transform to the array? Yeah, see PLy_input_setup_func and PLy_output_setup_func, which both say * Choose conversion method. Note that transform functions are checked * for composite and scalar types, but not for arrays or domains. This is * somewhat historical, but we'd have a problem allowing them on domains, * since we drill down through all levels of a domain nest without looking * at the intermediate levels at all. At least for arrays, it might be sufficient to switch the order of the array-lookup and transform-lookup cases to fix this. I don't think anyone's felt motivated to look into that, up to now. regards, tom lane