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