gpt4 book ai didi

postgresql - pg_restore 使用 ssl 证书

转载 作者:太空宇宙 更新时间:2023-11-03 13:58:03 26 4
gpt4 key购买 nike

有人可以帮助我使用 SSL 证书恢复 postgres 数据库吗?我尝试了以下方法,但没有用

pg_restore "host=hostname user=username dbname=database_name sslcert=sslcert.crt sslkey=sslkey.key sslrootcert=sslroot.pem sslmode=verify-full" -f filename

出现以下错误

pg_restore: [archiver] could not open input file "host=hostname user=username dbname=database_name sslcert=sslcert.crt sslkey=sslkey.key sslrootcert=sslroot.pem sslmode=verify-full": No such file or directory 

最佳答案

pg_restore 的参数不是连接字符串,而是要恢复的文件。您使用 -d 选项指定连接字符串:

pg_restore -d "host=..." filename

您可以通过这种方式指定任何参数。一个更详细的例子是:

pg_restore  --format=custom -d "port=5432 host=<hostname> 
user=<username> dbname=<dbname> sslrootcert=root.crt
sslkey=server.key sslcert=server.crt sslmode=verify-ca" ../filename.dump -v

请引用文档here .

关于postgresql - pg_restore 使用 ssl 证书,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58426536/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com