Skip to content

Commit

Permalink
doc: update docs/postgres.md (#436)
Browse files Browse the repository at this point in the history
  • Loading branch information
mailbaoer committed Sep 19, 2023
1 parent 71eb82a commit 5e12094
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions docs/postgres.md
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,31 @@ $ sudo systemctl restart postgresql

另见:[复制](https://www.postgresql.org/docs/current/sql-copy.html)

### 跨版本升级

pg_upgrade 跨版本升级

```shell
$ /usr/lib/postgresql/16/bin/pg_upgrade \
-b /usr/lib/postgresql/15/bin \
-B /usr/lib/postgresql/16/bin \
-d /var/lib/postgresql/15/main \
-D /var/lib/postgresql/16/main \
-o " -c config_file=/etc/postgresql/15/main/postgresql.conf" \
-O " -c config_file=/etc/postgresql/16/main/postgresql.conf"
```

-   `-b`   旧版本二进制文件目录
-   `-B`   新版本二进制文件目录
-   `-d`   旧版本数据目录
-   `-D`   新版本数据目录
-   `-o`   旧版本主配置文件
-   `-O`   新版本主配置文件
-   `-c`  `check`,不执行升级,可先加`-c`检查是否有报错,没有报错再运行升级
<!--rehype:className=style-none-->

使用 `pg_upgrade -?` 获取完整的选项列表

另见
----

Expand Down

0 comments on commit 5e12094

Please sign in to comment.