PSQL 命令行结束从 => 改为 (>

PSQL command line end changed from => to (>

我尝试执行从 \e 命令编写的查询,但现在我无法执行任何查询,但可以在 PSQL 中执行命令。

现在我注意到了这一点,我输入的命令现在在 \e 中。

当我关闭 \e(尝试 运行 它)时问题开始了。

您打开了一个括号但从未关闭它,而不是 psql 正在等待语句完成。

尝试输入 ); 来关闭括号(并收到一条错误消息)。

如果你完全迷路了,你可以用\q退出psql

psql 提示符会根据接下来期望的输入而变化。提示是 actually customisable, as documented here,但 PROMPT2 ("issued when more input is expected during command entry") 的默认值包含 %R,解释为:

In prompt 2 %R is replaced by a character that depends on why psql expects more input: - if the command simply wasn't terminated yet, but * if there is an unfinished /* ... */ comment, a single quote if there is an unfinished quoted string, a double quote if there is an unfinished quoted identifier, a dollar sign if there is an unfinished dollar-quoted string, or ( if there is an unmatched left parenthesis.

所以 (> 提示告诉你,在查询的某处,你打开了一个 (,而 psql 还在等待匹配的 ) 才解析您的意见。