美文网首页
Create DB in pg_restore

Create DB in pg_restore

作者: hzmangel | 来源:发表于2017-01-08 18:26 被阅读8次

最近在倒数据,有个pg_dump出来的archive,需要用pg_restore放到新的DB中去,由于基本是全新的DB,就把原来的数据库删了,想着用pg_restore直接创建就成了,但是在执行的时候一直报not found的错。最后在StackExchange上找到了答案

简而言之,就是传给 -C 参数的DB是在导入前的,而最后数据进入的DB还是从pg_dump命令生成的文件中获取,所以就找个存在的DB就好。

记住不要加上clean....

相关文章

网友评论

      本文标题:Create DB in pg_restore

      本文链接:https://www.haomeiwen.com/subject/jpknvttx.html