postgresql 如何在postgres中恢复tar文件?[关闭]

zpgglvta  于 5个月前  发布在  PostgreSQL
关注(0)|答案(2)|浏览(79)

**已关闭。**此问题为not about programming or software development。目前不接受回答。

此问题似乎与a specific programming problem, a software algorithm, or software tools primarily used by programmers无关。如果您认为此问题与another Stack Exchange site的主题相关,可以发表评论,说明在何处可以回答此问题。
21天前关闭
Improve this question
我试图在pgadmin 4中恢复.tar文件。
我创建了一个新的空数据库练习。然后点击练习>创建恢复>选择文件路径与数据选项作为前数据,数据,后数据选定。在恢复它,我得到一个错误。



纯文本中的错误提示:

C:\Program Files\PostgreSQL\16\pgAdmin 4\runtime\pg_restore.exe --host "localhost" --port "5432" --username "postgres" --no-password --dbname "exercises" --section=pre-data --section=data --section=post-data --verbose "C:\\Users\\Bhaskar\\DOWNLO~1\\EXERCI~1.TAR"

字符串
我也尝试过在没有任何数据选项的情况下恢复。
如何解决此错误

yqhsw0fo

yqhsw0fo1#

  • 使用终端导航到包含Tar文件的目录
  • 确保PostgreSQL Server正在运行:
  • 运行pg_restore命令:

第一个月
选项说明:
-verbose:显示进度信息。

  • clean:在恢复之前删除现有的数据库对象。
  • no-acl和--no-owner:忽略访问控制列表和所有权信息。
  • h localhost:指定主机(您可能需要调整此值)。
  • U your_username:指定连接到数据库的用户名。
  • d your_database_name:指定要还原的数据库的名称。
  • your_backup_file.tar:将其替换为tar文件的实际名称。根据您的特定需求和配置调整选项。
nnt7mjpx

nnt7mjpx2#

在执行以下步骤后,问题得到了解决
打开pgAdmin4并转到:

File > Preferences > Paths > Binary paths > PostgreSQL Binary Path
 > select the appropriate postgres version(you may not have the default version listed)
> select the bin folder of the version selected and click validate > Click OK

字符串

相关问题