소스 검색

docs: postgres

jeessy2 9 달 전
부모
커밋
739b2258d7
1개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 4 4
      README.md

+ 4 - 4
README.md

@@ -45,10 +45,10 @@
 
     |  说明   | 备份脚本  |
     |  ----  | ----  |
-    | 备份单个  | PGPASSWORD="#{PWD}" pg_dump --host 127.0.0.1 --port 5432 --dbname name --user postgres --create --file #{DATE}.sql |
-    | 备份全部  | PGPASSWORD="#{PWD}" pg_dumpall --host 127.0.0.1 --port 5432 --user postgres --create --file #{DATE}.sql |
-    | 还原  | psql -U postgres -f 2021-11-12_10_29.sql |
-    | 还原指定  | psql -U postgres -d name -f 2021-11-12_10_29.sql |
+    | 备份单个  | PGPASSWORD="#{PWD}" pg_dump --host 127.0.0.1 --port 5432 --user postgres --dbname name --format=custom --file #{DATE}.dump |
+    | 还原指定  | pg_restore --host 127.0.0.1 --port 5432 --user postgres -d name 2021-11-12-10-29.dump |
+    | 备份全部  | PGPASSWORD="#{PWD}" pg_dumpall --host 127.0.0.1 --port 5432 --user postgres --clean --file #{DATE}.sql |
+    | 还原全部  | psql -U postgres -f 2021-11-12-10-29.sql |
 
  -  mysql/mariadb