3

运行 Ubuntu 17.10 并且我在运行 Postgres 时遇到问题。几周前它还在工作,但现在我遇到了这个问题。

sudo su postgres psql

/usr/bin/psql: line 19: use: command not found
/usr/bin/psql: line 20: use: command not found
/usr/bin/psql: line 21: use: command not found
/usr/bin/psql: line 22: use: command not found
/usr/bin/psql: psql: line 24: syntax error near unexpected token `$version,'
/usr/bin/psql: psql: line 24: `my ($version, $cluster);'

我不知道该怎么做,语法看起来很正常。

4

1 回答 1

6

尝试

sudo -u postgres psql

反而。

我实际上不知道你的命令是做什么的。快速浏览man su并没有真正阐明su额外参数的作用,但显然它没有开始 psql,它可能正在将文件内容提供给 shell。

于 2018-03-16T19:43:58.847 回答