From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jim Nasby <Jim.Nasby@BlueTreble.com>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Subject: Re: Add support for SRF and returning composites to pl/tcl
Date: Sun, 06 Nov 2016 13:15:28 -0500
Message-ID: <8785.1478456128@sss.pgh.pa.us> (raw)
In-Reply-To: <8658.1478394740@sss.pgh.pa.us>
References: <f2134651-14b3-efeb-f274-c69f3c084031@BlueTreble.com>
<8658.1478394740@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, Jim.Nasby@BlueTreble.com
Subject: Re: Add support for SRF and returning composites to pl/tcl
In-Reply-To: <8785.1478456128@sss.pgh.pa.us>
References: <f2134651-14b3-efeb-f274-c69f3c084031@BlueTreble.com> <8658.1478394740@sss.pgh.pa.us> <8785.1478456128@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox