我需要使用 pg_dump 创建 Postgres 数据库转储。数据库位于 Kubernetes pod 中。我正在尝试以目录格式获取转储,而不仅仅是单个 .sql 文件。但我不明白如何指定目录。
当我尝试这个命令时:
kubectl exec patroni-0 -- bash -c "pg_dump -U username db_name --format=d" > db_dump_folder
我收到一个错误:
pg_dump: [directory archiver] no output directory specified
command terminated with exit code 1
提前致谢!