用sudo启动Postgresql的问题

时间:2018-03-16 18:14:05

标签: postgresql ubuntu-17.10

运行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);'

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

1 个答案:

答案 0 :(得分:1)

尝试

sudo -u postgres psql

代替。

我实际上不知道你的命令是做什么的。快速查看man su并未真正阐明su将对额外参数做什么,但显然它不是开始 psql,它可能正在提供文件内容到壳。