【问题标题】:Get error codes while using psql使用 psql 时获取错误代码
【发布时间】:2011-06-24 08:10:30
【问题描述】:

当我使用 psql.exe 运行 SQL 脚本时,发生错误时我没有收到错误代码。有没有办法获取 psql 错误代码?

我尝试像这样将 VERBOSITY 设置为“详细”,但没有用:

\set VERBOSITY 'verbose'

我使用的是 psql (PostgreSQL) 8.4.2 版本的 psql。

【问题讨论】:

  • 请将对您有帮助的答案标记为“答案”。

标签: postgresql psql


【解决方案1】:

去掉引号:

test=# \set VERBOSITY verbose
test=# select broken;
ERROR:  42703: column "broken" does not exist
LINE 1: select broken;
               ^
LOCATION:  transformColumnRef, parse_expr.c:766

【讨论】:

    猜你喜欢
    • 2013-04-04
    • 1970-01-01
    • 2015-04-16
    • 2012-11-16
    • 2018-10-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-05-22
    相关资源
    最近更新 更多