linux - postgres:无效参数:“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
尝试使用参数启动 postgres 进程,psql
但幸运的是失败了。如果要使用psql
客户端连接到 postgres 集群,请使用psql
. 所以如果你想用 sudo 运行它:
sudo -u zorgan psql postgres
这里 postgres 是 psql 的参数,它是 dbname...
https://www.postgresql.org/docs/current/static/app-psql.html
psql [选项...] [dbname [用户名]]
推荐阅读
- javascript - Redux 自定义 observeStore-function 的输入
- apache-spark - 在 Pyspark 数据框中创建 JSON
- python - 无法从跨两个包共享的命名空间导入符号
- flutter - 如果向下滑动以关闭,则颤振 GestureDetector
- windows - 使用 inno setup 如何使用版本更新应用程序?
- java - 如何限制并行化 Spring WebClient 响应的处理?
- networking - 网络示例 - IP 地址
- sql - 在没有子查询的情况下选择由同一个表中的另一个值排序的值
- amazon-web-services - 如何使用 cloudformation 在 AWS cognito 上设置验证属性?
- azure-log-analytics - 如何通过 kusto 查询将 JSON 输出(数组形式)投影为表格形式