[HACKERS] Endless loop calling PL/Python set returning functions

2016-03-10 Thread Alexey Grishchenko
PLy_function_delete_args is modified as well to check whether the key we intend to delete is in the globals dictionary. New regression test is included in the patch. -- Best regards, Alexey Grishchenko 0001-Fix-endless-loop-in-plpython-set-returning-function.patch Description: Binary data -- Sent via pgsql

Re: [HACKERS] Endless loop calling PL/Python set returning functions

2016-03-10 Thread Alexey Grishchenko
; dictionary. When internal function call finishes, it removes the key "a" from the dictionary, and the outer function fails with "NameError: global name 'a' is not defined" when it tries to execute "return a + r" But the second issue is a separate story and

Re: [HACKERS] Endless loop calling PL/Python set returning functions

2016-03-10 Thread Alexey Grishchenko
les and global dictionary ("GD"). I will think on this, maybe there might be a better design for this scenario. But I still think the second scenario requires a separate patch On Thu, Mar 10, 2016 at 4:33 PM, Tom Lane wrote: > Alexey Grishchenko writes: > > One scenario when t

Re: [HACKERS] Endless loop calling PL/Python set returning functions

2016-03-10 Thread Alexey Grishchenko
Tom Lane wrote: > Alexey Grishchenko > writes: > > No, my fix handles this well. > > In fact, with the first function call you allocate global variables > > representing Python function input parameters, call the function and > > receive iterator over the functio

Re: [HACKERS] Endless loop calling PL/Python set returning functions

2016-03-11 Thread Alexey Grishchenko
Alexey Grishchenko wrote: > Tom Lane wrote: > >> Alexey Grishchenko writes: >> > No, my fix handles this well. >> > In fact, with the first function call you allocate global variables >> > representing Python function input parameters, call the func

Re: [HACKERS] Endless loop calling PL/Python set returning functions

2016-03-22 Thread Alexey Grishchenko
Alexey Grishchenko wrote: > Alexey Grishchenko wrote: > >> Tom Lane wrote: >> >>> Alexey Grishchenko writes: >>> > No, my fix handles this well. >>> > In fact, with the first function call you allocate global variables >>> > repre

[HACKERS] Fix for PL/Python slow input arrays traversal issue

2016-07-28 Thread Alexey Grishchenko
union all pl_regression(# select null::int8 as a pl_regression(# ) as q; test 55 (1 row) Time: 22.839 ms -- Best regards, Alexey Grishchenko 0001-Fix-for-PL-Python-slow-input-arrays-traversal-issue.patch Description: Binary data -- Sent via pgsql-ha

[HACKERS] PL/Python adding support for multi-dimensional arrays

2016-08-03 Thread Alexey Grishchenko
# SELECT * FROM test_type_conversion_array_int4(ARRAY[[1,2,3],[4,5,6]]); INFO: ([[1, 2, 3], [4, 5, 6]], ) test_type_conversion_array_int4 ----- {{1,2,3},{4,5,6}} (1 row) -- Best regards, Alexey Grishchenko 0001-PL-Python-adding-support-for-multi-dimensional-array

Re: [HACKERS] PL/Python adding support for multi-dimensional arrays

2016-08-03 Thread Alexey Grishchenko
On Wed, Aug 3, 2016 at 12:49 PM, Alexey Grishchenko wrote: > Hi > > Current implementation of PL/Python does not allow the use of > multi-dimensional arrays, for both input and output parameters. This forces > end users to introduce workarounds like casting arrays to text before