SQL Shell 停止接受命令

SQL Shell stops taking commands

我正在学习一些 psql,目前 运行 在执行长命令后命令行光标从 =# 变为 '# 时遇到问题。 Shell 然后完全忽略所有命令。 有人可以解释一下这是什么问题以及如何 avoid/solve 它吗?

Active code page: 1251
Server [localhost]:
Database [postgres]:
Port [5432]:
Username [postgres]:
Password for user postgres:
psql (9.6.5)
WARNING: Console code page (1251) differs from Windows code page (1252)
         8-bit characters might not work correctly. See psql reference
         page "Notes for Windows users" for details.
Type "help" for help.

postgres=# insert into manuf values (3, 'manuf3', 'city2');
INSERT 0 1
postgres=# insert into manuf values (1, 'manuf1', 'city1')
postgres-# ;
INSERT 0 1
postgres=# insert into manuf values (2, 'manuf2', 'city2');
INSERT 0 1
postgres=# insert into product values (6, 'product6', 54, 34, 4), (5, 'product5', 34, 16, 5), (10, 'product10', 57, 4, 5), (9, 'product9', 66, 6, 2), (8, 'product8), 43, 16, 5), (7, 'product7', 76, 14, 3);
postgres'# \h
postgres'# WTF
postgres'# \q
postgres'#

我注意到,如果某个特定请求在第一次这样做,它总是会导致该问题。但并非所有具有相似长度的请求都会导致问题。

更新:

(8, 'product8', 43, 16, 5)

修正了这一行。还在想,为什么 shell 会这样,不给出任何错误信息,只是有点死机。

问题已在评论中解决,但再次重申: 在原始值列表中有一个拼写错误:(8, 'product8), 43, 16, 5) - 括号而不是引号,因此控制台正在等待结束字符串文字,这就是提示 '# 所指示的内容。这是许多控制台实现的标准行为,允许您逐行输入多行字符串或代码块

在 psql 中,按不带分号的 enter 键将语句继续到下一行。提示符也会更改以指示您在续行中。