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 is a

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 functions must

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 ***

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

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 safety

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 a

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

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

2006-02-24 Thread James Robinson
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 ... . Allowed following trivial test function to succeed: create or replace function set_gd(int) returns void as $$