Re: [HACKERS] Add support for SRF and returning composites to pl/tcl

2017-01-07 Thread Tom Lane
Jim Nasby writes: > On 1/6/17 2:45 PM, Tom Lane wrote: >> While I was checking the patch to verify that it didn't change any >> behavior, I noticed that it did, and there's a pre-existing bug here: >> pltcl_build_tuple_result is applying utf_e2u to the Tcl_GetString

Re: [HACKERS] Add support for SRF and returning composites to pl/tcl

2017-01-07 Thread Jim Nasby
On 1/6/17 2:45 PM, Tom Lane wrote: The only thing that seems significant is that we'd change the SQLSTATE for the "odd number of list items" error: pltcl_trigger_handler has (errcode(ERRCODE_E_R_I_E_TRIGGER_PROTOCOL_VIOLATED), errmsg("trigger's return list must have

Re: [HACKERS] Add support for SRF and returning composites to pl/tcl

2017-01-06 Thread Tom Lane
Jim Nasby writes: > On 11/8/16 8:33 AM, Tom Lane wrote: >> As things stand in HEAD, the behavior is about the same, but the error >> messages are not --- in one case they mention triggers and of course the >> other doesn't. There are a couple of other minor things in

Re: [HACKERS] Add support for SRF and returning composites to pl/tcl

2016-11-09 Thread Jim Nasby
On 11/8/16 8:33 AM, Tom Lane wrote: As things stand in HEAD, the behavior is about the same, but the error messages are not --- in one case they mention triggers and of course the other doesn't. There are a couple of other minor things in the way of unifying the two hunks of code, so I

Re: [HACKERS] Add support for SRF and returning composites to pl/tcl

2016-11-08 Thread Tom Lane
Jim Nasby writes: > Hrm, I completely spaced on the fact that composite returns are > essentially the same thing as trigger returns. ISTM we should be able to > use the same code for both. IIRC those magic elements could end up in > any SPI result, so that handling

Re: [HACKERS] Add support for SRF and returning composites to pl/tcl

2016-11-07 Thread Jim Nasby
On 11/6/16 12:15 PM, Tom Lane wrote: 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

Re: [HACKERS] Add support for SRF and returning composites to pl/tcl

2016-11-06 Thread Tom Lane
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

Re: [HACKERS] Add support for SRF and returning composites to pl/tcl

2016-11-05 Thread Pavel Stehule
2016-11-06 2:12 GMT+01:00 Tom Lane : > Jim Nasby writes: > > Attached is a patch that adds support for SRFs and returning composites > > from pl/tcl. This work was sponsored by Flight Aware. > > I spent a fair amount of time whacking this around,

Re: [HACKERS] Add support for SRF and returning composites to pl/tcl

2016-11-05 Thread Tom Lane
Jim Nasby writes: > Attached is a patch that adds support for SRFs and returning composites > from pl/tcl. This work was sponsored by Flight Aware. I spent a fair amount of time whacking this around, because I did not like the fact that you were using the

Re: [HACKERS] Add support for SRF and returning composites to pl/tcl

2016-11-05 Thread Pavel Stehule
Hi I checked this code, and it looks well 0. there are not any reason why we would not to implement this feature - more, the implementation is simple. 1. there was not problem with patching, compilation 2. the original patch is missing new expected result for regress tests, fixed in attached

[HACKERS] Add support for SRF and returning composites to pl/tcl

2016-10-12 Thread Jim Nasby
Attached is a patch that adds support for SRFs and returning composites from pl/tcl. This work was sponsored by Flight Aware. -- Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX Experts in Analytics, Data Architecture and PostgreSQL Data in Trouble? Get it in Treble!