1. 程式人生 > >postgres資料庫匯入匯出

postgres資料庫匯入匯出

windows下pg的資料庫的匯出:

匯出:pg_dump  -hlocalhost -p 5432 -d postgres -Upostgres -f "f:\dqwhsc"

匯入:psql -hlocalhost -p 5432 -d newdb -U postgres -f "f:\dqwhsc"

pg_restore回覆資料庫:

pg_restore -hlocalhost -p 5432 -d dqwhsc -U postgres "E:
\chinaunicom\deploy\20170928\dqwhpt_20170928020002"

--注意:如果是匯入的只有table,如果table不存在會自動建立,如果存在,資料會追加。

linux下:待完善