[置顶] PostgreSQL Linux 异构平台导数据

 1.Windows 导入

pg_dump.exe --host localhost --port 5432 --username "postgres" --format custom --blobs --encoding UTF8 --verbose --file "C:\Documents and Settings\Administrator\桌面\XXXX.backup" "XXXDBNAME"

 

2.Linux恢复命令
注意导出要用:tar格式导出,否则会出现pg_restore: [archiver] input file does not appear to be a valid archive错误
#su postgres

bash.3.1$pg_restore -d DBNAME -U postgres -W /post/XXX.backup

-d 指数据库参数 DBNAME填写已指定的数据库名

-U 指用户名

-W指口令,命令输入回车后系统提示输入


 

你可能感兴趣的:(c,linux,数据库,PostgreSQL,平台)