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 1iCmZ5-0007KQ-NT for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Sep 2019 15:17:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iCmZ4-0002Bk-K1 for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Sep 2019 15:17:18 +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 1iCmZ4-0002Bd-8x for pgsql-hackers@lists.postgresql.org; Tue, 24 Sep 2019 15:17:18 +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 1iCmZ1-00072O-Vx for pgsql-hackers@lists.postgresql.org; Tue, 24 Sep 2019 15:17:17 +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 x8OFHBip019229; Tue, 24 Sep 2019 11:17:12 -0400 From: Tom Lane To: rmrodriguez@carto.com cc: Anastasia Lubennikova , pgsql-hackers@lists.postgresql.org Subject: Re: Optimze usage of immutable functions as relation In-reply-to: References: <402356c32eeb93d4fed01f66d6c7fe2d@postgrespro.ru> <20180906185109.661aaef0@asp437-ThinkPad-L380> <153994199621.10161.17815885396545049364.pgcf@coridan.postgresql.org> <2906.1542395026@sss.pgh.pa.us> <3f7fda2f-1cdc-8ad3-e3c9-c2436fb5d509@postgrespro.ru> <0dd4efb2-22a3-6fef-11f7-1b20dd71a509@postgrespro.ru> <18924.1564165560@sss.pgh.pa.us> <18cbbbf6-5c03-41d5-5bd4-30048c2e5155@postgrespro.ru> <24410.1564700236@sss.pgh.pa.us> Comments: In-reply-to rmrodriguez@carto.com message dated "Tue, 24 Sep 2019 13:39:20 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <19227.1569338231.1@sss.pgh.pa.us> Date: Tue, 24 Sep 2019 11:17:11 -0400 Message-ID: <19228.1569338231@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk rmrodriguez@carto.com writes: > This commit is breaking some Postgis tests with custom types. Hm, yeah, the code fails to consider the possibility that the function returns a composite type. For the moment I'm just going to make it punt if the function result class isn't TYPEFUNC_SCALAR. In principle, if we have a composite result, we could disassemble it into per-column constant values, but I'm not sure it'd be worth the work. regards, tom lane