postgresql - 无法在 powershell 中运行 pg_basebackup
问题描述
我们正在尝试pg_basebackup
在 Powershell 中的 Windows 上运行脚本。该命令似乎在 windows 命令行 ( cmd
) 中有效,但在powershell
某些机器上无效。我们以管理员身份运行 Powershell。有没有人遇到过这个?
以下是我们正在运行的命令:
pg_basebackup --host "localhost" --port "5432" --username="test" --password="testpassword" --progress --verbose -D "C:\test\master\base_backups\test"
解决方案
尝试使用这个
# Put here your pg_basebackup file location
Set-Location "C:\PostgreSQL\9.6\bin"
# Put Here your password
$env:PGPASSWORD = "testpassword"
[string]$job = .\pg_basebackup --% -U test --progress --verbose -D "C:\test\master\base_backups\test"
结果将是$job
可变的。
推荐阅读
- python - 需要以下参数
- r - 使用带有 tidy-select 的符号列表
- ansible - 断言条件后将失败任务状态重定向到文件
- javascript - 尝试发表评论(或评论)时出现错误 我不清楚问题是什么
- swift - AppInformation 的 View.environmentObject(_:) 作为此视图的祖先可能会丢失
- r - 制作这样的条形图
- php - How to show another php files other than Drupal8
- python - Why manager.dict and manager.list is slow and sometimes cause deadlock?
- python-2.7 - How extract .msi file's icon with python27
- c++ - How to read register values at specific instructions in C++ like Cheat Engine does?