From c736bf233c5647c47e95f76aaa8e1f8a24a90cbb Mon Sep 17 00:00:00 2001 From: Loyal-Young <266632325+Loyal-Young@users.noreply.github.com> Date: Wed, 11 Nov 2026 16:39:54 +0800 Subject: [PATCH] docs: explain PostgreSQL and Oracle connection ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Document both compatibility listeners and how to verify session mode in the English and Chinese quick start guides. Clarify the Docker port mapping. This moves the changes proposed in IvorySQL/IvorySQL#3173 to the documentation repository. Assisted-by: Codex:GPT-6 Percentage of AI-generated code: 100% Signed-off-by: 王泽浩 <266632325+Loyal-Young@users.noreply.github.com> --- .../master/getting-started/quick_start.adoc | 17 ++++++++++++++++- .../master/getting-started/quick_start.adoc | 17 ++++++++++++++++- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/CN/modules/ROOT/pages/master/getting-started/quick_start.adoc b/CN/modules/ROOT/pages/master/getting-started/quick_start.adoc index 1244a31e..7be58e29 100644 --- a/CN/modules/ROOT/pages/master/getting-started/quick_start.adoc +++ b/CN/modules/ROOT/pages/master/getting-started/quick_start.adoc @@ -146,7 +146,22 @@ ivorysql=# 更多参数使用方法,请使用psql --help命令获取。 .... -TIP: Docker运行IvorySQL时,需要添加额外参数,如 psql -d ivorysql -U ivorysql -h 127.0.0.1 -p 5434 +=== 连接不同兼容模式 + +通过 `initdb -m oracle` 初始化的集群提供两个监听端口。默认情况下,5432 端口的会话以 PostgreSQL 兼容模式启动,1521 端口的会话以 Oracle 兼容模式启动。运行 Oracle SQL 或 PL/iSQL 示例时,请连接 Oracle 端口。 + +[source,shell] +---- +# 预期模式为 pg +psql -X -p 5432 -d ivorysql -c 'SHOW ivorysql.compatible_mode' + +# 预期模式为 oracle +psql -X -p 1521 -d ivorysql -c 'SHOW ivorysql.compatible_mode' +---- + +如果服务器使用自定义端口,请以 `port` 和 `ivorysql.port` 的配置值为准。通过 `initdb -m pg` 初始化的集群只提供 PostgreSQL 监听端口。 + +TIP: 上面的 Docker 示例将 PostgreSQL 监听端口映射到主机的 5434 端口。使用 `psql -d ivorysql -U ivorysql -h 127.0.0.1 -p 5434` 连接。如需从主机连接 Oracle 模式容器的 Oracle 监听端口,还需映射该端口。 现在可以开始使用IvorySQL啦!就是这么简单! diff --git a/EN/modules/ROOT/pages/master/getting-started/quick_start.adoc b/EN/modules/ROOT/pages/master/getting-started/quick_start.adoc index ff0a0f0a..5345fbce 100644 --- a/EN/modules/ROOT/pages/master/getting-started/quick_start.adoc +++ b/EN/modules/ROOT/pages/master/getting-started/quick_start.adoc @@ -141,7 +141,22 @@ ivorysql=# For more options, refer to psql --help. .... -TIP: When running IvorySQL in Docker, additional parameters need to be added, like: psql -d ivorysql -U ivorysql -h 127.0.0.1 -p 5434 +=== Connect to each compatibility mode + +A cluster initialized with `initdb -m oracle` has two listeners. By default, port 5432 starts sessions in PostgreSQL compatibility mode and port 1521 starts sessions in Oracle compatibility mode. Use the Oracle port for Oracle SQL or PL/iSQL examples. + +[source,shell] +---- +# Expected mode is pg +psql -X -p 5432 -d ivorysql -c 'SHOW ivorysql.compatible_mode' + +# Expected mode is oracle +psql -X -p 1521 -d ivorysql -c 'SHOW ivorysql.compatible_mode' +---- + +Use the configured `port` and `ivorysql.port` values if the server uses custom ports. A cluster initialized with `initdb -m pg` provides only the PostgreSQL listener. + +TIP: The Docker example above maps the PostgreSQL listener to host port 5434. Connect with `psql -d ivorysql -U ivorysql -h 127.0.0.1 -p 5434`. To reach an Oracle-mode container's Oracle listener from the host, publish the Oracle port as well. Now you can start your journey of IvorySQL! Enjoy!