mirror of
https://github.com/postgres/postgres.git
synced 2026-02-03 20:40:14 -05:00
with some amount of cleanliness. I see no need to report the internal Python name rather than the SQL procedure name in error tracebacks.
39 lines
1.4 KiB
Text
39 lines
1.4 KiB
Text
SELECT invalid_type_uncaught('rick');
|
|
WARNING: plpython: in function invalid_type_uncaught:
|
|
plpy.SPIError: Unknown error in PLy_spi_prepare.
|
|
ERROR: Type "test" does not exist
|
|
SELECT invalid_type_caught('rick');
|
|
WARNING: plpython: in function invalid_type_caught:
|
|
plpy.SPIError: Unknown error in PLy_spi_prepare.
|
|
ERROR: Type "test" does not exist
|
|
SELECT invalid_type_reraised('rick');
|
|
WARNING: plpython: in function invalid_type_reraised:
|
|
plpy.SPIError: Unknown error in PLy_spi_prepare.
|
|
ERROR: Type "test" does not exist
|
|
SELECT valid_type('rick');
|
|
valid_type
|
|
------------
|
|
|
|
(1 row)
|
|
|
|
SELECT read_file('/etc/passwd');
|
|
ERROR: plpython: Call of function `read_file' failed.
|
|
exceptions.IOError: can't open files in restricted mode
|
|
SELECT write_file('/tmp/plpython','This is very bad');
|
|
ERROR: plpython: Call of function `write_file' failed.
|
|
exceptions.IOError: can't open files in restricted mode
|
|
SELECT getpid();
|
|
ERROR: plpython: Call of function `getpid' failed.
|
|
exceptions.AttributeError: 'module' object has no attribute 'getpid'
|
|
SELECT uname();
|
|
ERROR: plpython: Call of function `uname' failed.
|
|
exceptions.AttributeError: 'module' object has no attribute 'uname'
|
|
SELECT sys_exit();
|
|
ERROR: plpython: Call of function `sys_exit' failed.
|
|
exceptions.AttributeError: 'module' object has no attribute 'exit'
|
|
SELECT sys_argv();
|
|
sys_argv
|
|
----------------
|
|
['RESTRICTED']
|
|
(1 row)
|
|
|