Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c3Rym-0001rO-Vq for pgsql-hackers@arkaria.postgresql.org; Sun, 06 Nov 2016 18:15:41 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1c3Rym-00036Q-F4 for pgsql-hackers@arkaria.postgresql.org; Sun, 06 Nov 2016 18:15:40 +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_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1c3Rym-00036K-3R for pgsql-hackers@postgresql.org; Sun, 06 Nov 2016 18:15:40 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1c3Ryf-0004Vg-IN for pgsql-hackers@postgresql.org; Sun, 06 Nov 2016 18:15:39 +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 uA6IFS15008786; Sun, 6 Nov 2016 13:15:28 -0500 From: Tom Lane To: Jim Nasby cc: Pg Hackers Subject: Re: Add support for SRF and returning composites to pl/tcl In-reply-to: <8658.1478394740@sss.pgh.pa.us> References: <8658.1478394740@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Sat, 05 Nov 2016 21:12:20 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <8784.1478456128.1@sss.pgh.pa.us> Date: Sun, 06 Nov 2016 13:15:28 -0500 Message-ID: <8785.1478456128@sss.pgh.pa.us> X-Pg-Spam-Score: -3.9 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org I wrote: > I got the code to a state that I liked (attached), and started reviewing > the docs, and then it occurred to me to wonder why you'd chosen to use > Tcl lists to represent composite output values. The precedent established > by input argument handling is that composites are transformed to Tcl > arrays. So shouldn't we use an array to represent a composite result, > too? After further nosing around I see that the return-a-tuple-as-a-list concept is already embedded in pltcl_trigger_handler. So the inconsistency is already there, and it's not necessarily this patch's job to fix it. Still seems like we might want to allow using an array directly rather than insisting on conversion to a list, but that's a task for a separate patch. We should, however, make some attempt to ensure that the list-to-tuple conversion semantics are the same in both cases. In particular I notice some undocumented behavior around a magic ".tupno" element. Will see about cleaning that up. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers