]> granicus.if.org Git - postgresql/commit
Improve exception usage in PL/Python
authorPeter Eisentraut <peter_e@gmx.net>
Wed, 26 Jan 2011 22:47:14 +0000 (00:47 +0200)
committerPeter Eisentraut <peter_e@gmx.net>
Wed, 26 Jan 2011 22:47:14 +0000 (00:47 +0200)
commit582b5ac62e74a553e72151b321804a7b2e5fed6f
tree8d775582a473f50ff4fffdca6008fc6bd4b4dac6
parent418df3a5dd94d9f02b895f9c161b2435d61e0729
Improve exception usage in PL/Python

Use the built-in TypeError, not SPIError, for errors having to do with
argument counts or types.  Use SPIError, not simply plpy.Error, for
errors in PLy_spi_execute_plan.  Finally, do not set a Python
exception if PyArg_ParseTuple failed, as it already sets the correct
exception.

Jan UrbaƄski
src/pl/plpython/expected/plpython_unicode_2.out
src/pl/plpython/expected/plpython_unicode_3.out
src/pl/plpython/plpython.c