The attached patch fixes a bug reported by Kevin Jacobs
> When we create a function like so:
>
> CREATE OR REPLACE FUNCTION jojo (timestamp) RETURNS varchar AS '
> pln = plpy.prepare("UPDATE jtab SET jfld = $1",["timestamp"])
> rcs = plpy.execute(pln,[args[0]])
> return "YES"' LANGUAGE 'PLPYTHON';
>
> SELECT jojo(now());
> works fine but
>
> SELECT jojo(NULL);
> errors out with
> NOTICE: plpython: in function __plpython_procedure_jojo_49818349:
> plpy.Error: Unknown error in PLy_spi_execute_plan
> ERROR: Bad timestamp external representation 'None'
NULL arguments were improperly converted to the string 'None' rather than being marked
as NULLs in the third argument to SPI_execp. The patch is against CVS HEAD.
--
Andrew Bosma <bosma@epigenomix.com>
Andrew Bosma <bosma@epigenomix.com> writes:
> NULL arguments were improperly converted to the string 'None' rather than being marked
> as NULLs in the third argument to SPI_execp. The patch is against CVS HEAD.
Patch applied to HEAD and 7.3 branch. Thanks!
regards, tom lane
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/users-lounge/docs/faq.html
Andrew Bosma <bosma@epigenomix.com> writes:
> NULL arguments were improperly converted to the string 'None' rather than being marked
> as NULLs in the third argument to SPI_execp. The patch is against CVS HEAD.
Patch applied to HEAD and 7.3 branch. Thanks!
regards, tom lane
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/users-lounge/docs/faq.html
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера