From 2e12bb6b765eae6f48822cc3f8ab336f6e73637c Mon Sep 17 00:00:00 2001 From: wang1r <923096443@qq.com> Date: Mon, 19 Oct 2026 08:22:04 +0800 Subject: [PATCH] docs: correct pg_dump connection environment variables Use the PGHOST and PGPORT names recognized by libpq in both the English and Chinese backup instructions. Fixes #342 --- CN/modules/ROOT/pages/4.4.adoc | 2 +- EN/modules/ROOT/pages/4.4.adoc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CN/modules/ROOT/pages/4.4.adoc b/CN/modules/ROOT/pages/4.4.adoc index 0c5e0088..ab8e3034 100644 --- a/CN/modules/ROOT/pages/4.4.adoc +++ b/CN/modules/ROOT/pages/4.4.adoc @@ -385,7 +385,7 @@ pg_dump dbname > dumpfile ​ pg_dump是一个普通的IvorySQL客户端应用(尽管是个 相当聪明的东西)。这就意味着你可以在任何可以访问该数据库的远端主机上进行备份工作。但是请记住 pg_dump不会以任何特殊权限运行。具体说来,就是它必须要有你想备份的表的读权限,因此为了备份整个数据库你几乎总是必须以一个数据库超级用户来运行它(如果你没有足够的特权来备份整个数据库,你仍然可以使用诸如-n schema 或-t table选项来备份该数据库中你能够访问的部分)。 -​ 要声明pg_dump连接哪个数据库服务器,使用命令行选项-h host和 -p port。 默认主机是本地主机或你的HOST环境变量指定的主机。 类似地,默认端口是环境变量PORT或(如果PORT不存在)内建的默认值。 (服务器通常有相同的默认值,所以还算方便。) +​ 要声明pg_dump连接哪个数据库服务器,使用命令行选项-h host和 -p port。 默认主机是本地主机或你的PGHOST环境变量指定的主机。 类似地,默认端口是环境变量PGPORT或(如果PGPORT不存在)内建的默认值。 (服务器通常有相同的默认值,所以还算方便。) ​ pg_dump默认使用与当前操作系统用户名同名的数据库用户名进行连接。 要使用其他名字,要么声明-U选项,要么设置环境变量PGUSER。请注意pg_dump的连接也要通过客户认证机制。 diff --git a/EN/modules/ROOT/pages/4.4.adoc b/EN/modules/ROOT/pages/4.4.adoc index 43215cd5..1c0c2206 100644 --- a/EN/modules/ROOT/pages/4.4.adoc +++ b/EN/modules/ROOT/pages/4.4.adoc @@ -363,7 +363,7 @@ As you see, pg_dump writes its result to the standard output. We will see below pg_dump is a regular IvorySQL client application (albeit a particularly clever one). This means that you can perform this backup procedure from any remote host that has access to the database. pg_dump must have read access to all tables that you want to back up, so in order to back up the entire database you almost always have to run it as a database superuser. (If you do not have sufficient privileges to back up the entire database, you can still back up portions of the database to which you do have access using options such as `-n *`schema`*` or `-t *`table`*`.) -​To specify which database server pg_dump should contact, use the command line options `-h *`host`*` and `-p *`port`*`. The default host is the local host or whatever your `HOST` environment variable specifies. Similarly, the default port is indicated by the `PORT` environment variable or, failing that, by the compiled-in default. (Conveniently, the server will normally have the same compiled-in default.) +​To specify which database server pg_dump should contact, use the command line options `-h *`host`*` and `-p *`port`*`. The default host is the local host or whatever your `PGHOST` environment variable specifies. Similarly, the default port is indicated by the `PGPORT` environment variable or, failing that, by the compiled-in default. (Conveniently, the server will normally have the same compiled-in default.) pg_dump will by default connect with the database user name that is equal to the current operating system user name. To override this, either specify the `-U` option or set the environment variable `PGUSER`. Remember that pg_dump connections are subject to the normal client authentication mechanisms 。