Re: [PATCHES] 2 line patch to allow plpythonu functions to return

2006-02-28 Thread Neil Conway
On Tue, 2006-02-28 at 15:26 -0500, Tom Lane wrote: > Yeah, "unexpected" doesn't seem the mot juste here. [...] All good points -- thanks for the suggestions. I've applied the attached patch to HEAD. -Neil *** src/pl/plpython/expected/p

Re: [PATCHES] 2 line patch to allow plpythonu functions to return

2006-02-28 Thread Tom Lane
Neil Conway <[EMAIL PROTECTED]> writes: > Applied to HEAD. I'm still not quite satisfied with the error message: > ereport(ERROR, > (errcode(ERRCODE_DATATYPE_MISMATCH), >errmsg("unexpected return value from plpython procedure"), >errdetail("void-returning functi

Re: [PATCHES] 2 line patch to allow plpythonu functions to return

2006-02-28 Thread Neil Conway
On Sun, 2006-02-26 at 18:40 -0500, Neil Conway wrote: > Tom Lane wrote: > > This sort of thing normally requires more thought than just removing > > the safety check. What happens when the python code does/doesn't return > > a value, in both cases (declared return type void or not)? > > Attached

Re: [PATCHES] 2 line patch to allow plpythonu functions to return

2006-02-26 Thread Neil Conway
Tom Lane wrote: This sort of thing normally requires more thought than just removing the safety check. What happens when the python code does/doesn't return a value, in both cases (declared return type void or not)? Attached is a more complete patch: - if the function is declared to return vo

Re: [PATCHES] 2 line patch to allow plpythonu functions to return void ...

2006-02-25 Thread James Robinson
On Feb 25, 2006, at 12:10 PM, Tom Lane wrote: James Robinson <[EMAIL PROTECTED]> writes: Shamelessly cloned from the parallel code in pltcl, an exception for void in denying pseudotypes being returned. Pl/tcl didn't reference VOIDOID anywhere else, so ... . This sort of thing normally requir

Re: [PATCHES] 2 line patch to allow plpythonu functions to return void ...

2006-02-25 Thread Harald Armin Massa
Tom,This sort of thing normally requires more thought than just removingthe safety check.  What happens when the python code does/doesn't return a value, in both cases (declared return type void or not)?python functions are specified to return "None", if no return is given. I recommend to also see

Re: [PATCHES] 2 line patch to allow plpythonu functions to return void ...

2006-02-25 Thread Tom Lane
James Robinson <[EMAIL PROTECTED]> writes: > Shamelessly cloned from the parallel code in pltcl, an exception for > void in denying pseudotypes being returned. Pl/tcl didn't reference > VOIDOID anywhere else, so ... . This sort of thing normally requires more thought than just removing the saf