PostgreSQL备份与还原指定数据库数据
备份(pg_dump)
pg_dump -h [127.0.0.1] -U [postgres] -d [dbname] -f [dump.sql]
还原(psql)
psql -h [127.0.0.1] -U [postgres] -d [dbname] -f [dump.sql/*.dmp]
Postgresql导出指定的数据表
两对双引号""""是用于解决:pg_dump: no matching tables were found 问题。
pg_dump -h localhost -p 5432 -U postgres -d mydb -t "“demoTable1"” -t "“demoTable2"” > backup.sql