使用psql时遇到错误代码

11

我在使用psql.exe运行SQL脚本时,当出现错误时没有得到错误代码。是否有方法可以获取psql的错误代码?

我尝试将VERBOSITY设置为'verbose',但无效:

\set VERBOSITY 'verbose'

我正在使用版本为 psql (PostgreSQL) 8.4.2 的 psql。


1
请将帮助您的答案标记为“答案”。 - hakre
1个回答

19

去掉引号:

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

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接