1 -- test error handling, i forgot to restore Warn_restart in
2 -- the trigger handler once. the errors and subsequent core dump were
4 SELECT invalid_type_uncaught('rick');
5 WARNING: PL/Python: in PL/Python function "invalid_type_uncaught"
6 DETAIL: <class 'plpy.SPIError'>: unrecognized error in PLy_spi_prepare
7 ERROR: type "test" does not exist
8 SELECT invalid_type_caught('rick');
9 WARNING: PL/Python: in PL/Python function "invalid_type_caught"
10 DETAIL: <class 'plpy.SPIError'>: unrecognized error in PLy_spi_prepare
11 ERROR: type "test" does not exist
12 SELECT invalid_type_reraised('rick');
13 WARNING: PL/Python: in PL/Python function "invalid_type_reraised"
14 DETAIL: <class 'plpy.SPIError'>: unrecognized error in PLy_spi_prepare
15 ERROR: type "test" does not exist
16 SELECT valid_type('rick');
23 -- Test Unicode error handling.
25 SELECT unicode_return_error();
26 ERROR: PL/Python: could not create string representation of Python object in PL/Python function "unicode_return_error" while creating return value
27 DETAIL: <type 'exceptions.UnicodeEncodeError'>: 'ascii' codec can't encode character u'\x80' in position 0: ordinal not in range(128)
28 INSERT INTO unicode_test (testvalue) VALUES ('test');
29 ERROR: PL/Python: could not compute string representation of Python object in PL/Python function "unicode_trigger_error" while modifying trigger row
30 DETAIL: <type 'exceptions.UnicodeEncodeError'>: 'ascii' codec can't encode character u'\x80' in position 0: ordinal not in range(128)
31 SELECT unicode_plan_error1();
32 WARNING: PL/Python: in PL/Python function "unicode_plan_error1"
33 DETAIL: <class 'plpy.Error'>: unrecognized error in PLy_spi_execute_plan
34 ERROR: PL/Python: PL/Python function "unicode_plan_error1" could not execute plan
35 DETAIL: <type 'exceptions.UnicodeEncodeError'>: 'ascii' codec can't encode character u'\x80' in position 0: ordinal not in range(128)
36 SELECT unicode_plan_error2();
37 ERROR: PL/Python: PL/Python function "unicode_plan_error2" could not execute plan
38 DETAIL: <type 'exceptions.UnicodeEncodeError'>: 'ascii' codec can't encode character u'\x80' in position 0: ordinal not in range(128)