如何将文本 postgres 错误消息转换为错误代码?
例如:
permission denied for relation table
如何在这里找到它属于哪个错误代码? https://www.postgresql.org/docs/current/static/errcodes-appendix.html
最佳答案
检查 postgresql.conf
中的 log_line_prefix
设置。确保使用此 %e
选项将代码记录在 postgres 日志中。
%e
= SQL 状态
您还可以在 psql
中使用 \set VERBOSITY verbose
来查看那里的 SQLSTATE
的详细错误。
关于postgresql - Postgres 错误代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45464812/