---
title: "postgreSQL备份"
author: "ayanline"
date: "2011-11-24T09:48:59Z"
tags: []
categories: ["数据库"]
slug: "postgresql"
draft: false
lastmod: "2011-11-24T09:48:59Z"
id: 1276421
url: "https://ayanline.iteye.com/blog/1276421"
---

本人是个新手，现在用pg\_dump给数据库test备份，指令为：  
pg\_dump -d test  
恢复指令为：  
dropdb  test  
pg\_restore -C -d test db.dump  
然后出现错误：  
\[Archiver]input file does not a vaild file of archive.  
请教这是为什么啊？谢谢！

**trainee**

pg\_dump有2种格式  
1、文本格式（默认格式），用psql恢复  
2、archive格式， 用pg\_restore恢复