簡體   English   中英

postgres:無效參數:“ psql”

[英]postgres: invalid argument: “psql”

當我執行sudo -u zorgan postgres psql啟動我的postgres會話時,它返回:

postgres: invalid argument: "psql"

如果我刪除psql它將返回:

postgres does not know where to find the server configuration file.
You must specify the --config-file or -D invocation option or set the PGDATA environment variable.

知道是什么問題嗎?

https://www.sudo.ws/man/1.8.18/sudo.man.html

[-u用戶] [命令]

所以在你的情況下:

sudo -u zorgan postgres psql

嘗試使用參數psql啟動postgres進程,但失敗了。 如果要使用psql客戶端連接到postgres集群,請使用psql 因此,如果您希望使用sudo運行它:

sudo -u zorgan psql postgres

這里postgres是psql的參數,它是dbname ...

https://www.postgresql.org/docs/current/static/app-psql.html

psql [選項...] [dbname [用戶名]]

sudo -u postgres psql

上面的postgres是一個用戶。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM