我正在尝试制作一条单行的psql请求。我希望能够同时发送凭据和查询。我正在使用以下方式:
psql.exe "dbname=dbname user=postgres password=postgres host=localhost" -c 'select * from table'
实际上,如果我去掉-c选项,它可以正常工作,但现在它会给我发送这个错误信息:
psql: attention : option supplémentaire « 'select » ignorée
psql: attention : option supplémentaire « * » ignorée
psql: attention : option supplémentaire « from » ignorée
psql: attention : option supplémentaire « view' » ignorée
与数据库的连接已经建立,但是这些日志是用法语书写的,意思是“注意:选项被跳过”。
我尝试使用 URL 请求。
psql.exe postgresql://postgres:postgres@localhost/dbname -c 'select * from view'
但这是一样的。
你有任何想法,我在哪里出错了吗?
谢谢!