[英]How to make PL/Python tracebacks more verbose?
当前在发生错误的情况下,我在PL / Python过程的psql
有这样的回溯,它会导入Python模块并从中调用一些函数:
ERROR: AssertionError:
CONTEXT: Traceback (most recent call last):
PL/Python function "tempo_timeintervalset_contains", line 6, in <module>
TimeIntervalSet.from_json(timeintervalset))
PL/Python function "tempo_timeintervalset_contains", line 209, in __contains__
PL/Python function "tempo_timeintervalset_contains", line 106, in _walk
PL/Python function "tempo_timeintervalset_contains", line 41, in _evaluate
PL/Python function "tempo_timeintervalset_contains", line 200, in callback
PL/Python function "tempo_timeintervalset_contains", line 91, in __contains__
PL/Python function "tempo_timeintervalset_contains"
我试图在postgresql.conf
设置log_error_verbosity = verbose
并设置此环境变量PYTHONVERBOSE=1 PYTHONDEBUG=1
。 没有任何帮助。
谁知道,如何在可能的情况下将其设置为更详细?
我知道这已经很老了,但是我发现这很好。
create function python_version()
returns text
language plpythonu
as $$
import sys
import traceback
try:
return sys.version
except:
error = sys.exc_info()[0]
details = traceback.format_exc()
plpy.error('%s: %s' % ( error, details ) )
$$;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.