2006-11-21 16:51:05 -05:00
|
|
|
-- test error handling, i forgot to restore Warn_restart in
|
|
|
|
|
-- the trigger handler once. the errors and subsequent core dump were
|
|
|
|
|
-- interesting.
|
|
|
|
|
SELECT invalid_type_uncaught('rick');
|
2009-07-20 04:01:07 -04:00
|
|
|
WARNING: PL/Python: <class 'plpy.SPIError'>: unrecognized error in PLy_spi_prepare
|
|
|
|
|
CONTEXT: PL/Python function "invalid_type_uncaught"
|
2006-11-21 16:51:05 -05:00
|
|
|
ERROR: type "test" does not exist
|
2009-07-20 04:01:07 -04:00
|
|
|
CONTEXT: PL/Python function "invalid_type_uncaught"
|
2006-11-21 16:51:05 -05:00
|
|
|
SELECT invalid_type_caught('rick');
|
2009-07-20 04:01:07 -04:00
|
|
|
WARNING: PL/Python: <class 'plpy.SPIError'>: unrecognized error in PLy_spi_prepare
|
|
|
|
|
CONTEXT: PL/Python function "invalid_type_caught"
|
2006-11-21 16:51:05 -05:00
|
|
|
ERROR: type "test" does not exist
|
2009-07-20 04:01:07 -04:00
|
|
|
CONTEXT: PL/Python function "invalid_type_caught"
|
2006-11-21 16:51:05 -05:00
|
|
|
SELECT invalid_type_reraised('rick');
|
2009-07-20 04:01:07 -04:00
|
|
|
WARNING: PL/Python: <class 'plpy.SPIError'>: unrecognized error in PLy_spi_prepare
|
|
|
|
|
CONTEXT: PL/Python function "invalid_type_reraised"
|
2006-11-21 16:51:05 -05:00
|
|
|
ERROR: type "test" does not exist
|
2009-07-20 04:01:07 -04:00
|
|
|
CONTEXT: PL/Python function "invalid_type_reraised"
|
2006-11-21 16:51:05 -05:00
|
|
|
SELECT valid_type('rick');
|
|
|
|
|
valid_type
|
|
|
|
|
------------
|
|
|
|
|
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Test Unicode error handling.
|
|
|
|
|
--
|
|
|
|
|
SELECT unicode_return_error();
|
2009-07-20 04:01:07 -04:00
|
|
|
ERROR: PL/Python: could not create string representation of Python object, while creating return value
|
2006-11-21 16:51:05 -05:00
|
|
|
DETAIL: <type 'exceptions.UnicodeEncodeError'>: 'ascii' codec can't encode character u'\x80' in position 0: ordinal not in range(128)
|
2009-07-20 04:01:07 -04:00
|
|
|
CONTEXT: PL/Python function "unicode_return_error"
|
2006-11-21 16:51:05 -05:00
|
|
|
INSERT INTO unicode_test (testvalue) VALUES ('test');
|
2009-07-20 04:01:07 -04:00
|
|
|
ERROR: PL/Python: could not compute string representation of Python object, while modifying trigger row
|
2006-11-21 16:51:05 -05:00
|
|
|
DETAIL: <type 'exceptions.UnicodeEncodeError'>: 'ascii' codec can't encode character u'\x80' in position 0: ordinal not in range(128)
|
2009-07-20 04:01:07 -04:00
|
|
|
CONTEXT: PL/Python function "unicode_trigger_error"
|
2006-11-21 16:51:05 -05:00
|
|
|
SELECT unicode_plan_error1();
|
2009-07-20 04:01:07 -04:00
|
|
|
WARNING: PL/Python: <class 'plpy.Error'>: unrecognized error in PLy_spi_execute_plan
|
|
|
|
|
CONTEXT: PL/Python function "unicode_plan_error1"
|
|
|
|
|
ERROR: PL/Python: could not execute plan
|
2006-11-21 16:51:05 -05:00
|
|
|
DETAIL: <type 'exceptions.UnicodeEncodeError'>: 'ascii' codec can't encode character u'\x80' in position 0: ordinal not in range(128)
|
2009-07-20 04:01:07 -04:00
|
|
|
CONTEXT: PL/Python function "unicode_plan_error1"
|
2006-11-21 16:51:05 -05:00
|
|
|
SELECT unicode_plan_error2();
|
2009-07-20 04:01:07 -04:00
|
|
|
ERROR: PL/Python: could not execute plan
|
2006-11-21 16:51:05 -05:00
|
|
|
DETAIL: <type 'exceptions.UnicodeEncodeError'>: 'ascii' codec can't encode character u'\x80' in position 0: ordinal not in range(128)
|
2009-07-20 04:01:07 -04:00
|
|
|
CONTEXT: PL/Python function "unicode_plan_error2"
|