Re: 2 line patch to allow plpythonu functions to return - Mailing list pgsql-patches

From Tom Lane
Subject Re: 2 line patch to allow plpythonu functions to return
Date
Msg-id 23894.1141158375@sss.pgh.pa.us
Whole thread Raw
In response to Re: 2 line patch to allow plpythonu functions to return  (Neil Conway <neilc@samurai.com>)
Responses Re: 2 line patch to allow plpythonu functions to return  (Neil Conway <neilc@samurai.com>)
List pgsql-patches
Neil Conway <neilc@samurai.com> 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 return \"None\"")));

> Suggestions for something better?

Yeah, "unexpected" doesn't seem the mot juste here.  Perhaps "invalid"
or "incorrect" (our message style guidelines seem to suggest "invalid"
as a good word in such cases).  Also, say "function" not "procedure"
because that's what it is in SQL terms.

Also, the errdetail doesn't follow the guideline that says detail
messages should be full sentences with proper capitalization and
punctuation.  Perhaps

    Functions returning type "void" must return "None".

            regards, tom lane

pgsql-patches by date:

Previous
From: Neil Conway
Date:
Subject: Re: 2 line patch to allow plpythonu functions to return
Next
From: Andrew Dunstan
Date:
Subject: Re: [PATCH] Prompt for password on Windows platforms