From 350c9e9a80b160010758a1c1c0bdd6c74c1064b9 Mon Sep 17 00:00:00 2001 From: yuan li Date: Tue, 4 Nov 2025 13:25:05 +0800 Subject: [PATCH 1/2] modify document for postgis extension --- CN/modules/ROOT/nav.adoc | 1 + CN/modules/ROOT/pages/master/5.0.adoc | 1 + CN/modules/ROOT/pages/master/5.1.adoc | 115 +++++++----------------- EN/modules/ROOT/nav.adoc | 3 +- EN/modules/ROOT/pages/master/5.0.adoc | 1 + EN/modules/ROOT/pages/master/5.1.adoc | 120 ++++++++------------------ 6 files changed, 71 insertions(+), 170 deletions(-) diff --git a/CN/modules/ROOT/nav.adoc b/CN/modules/ROOT/nav.adoc index db182edb..9f57f3ea 100644 --- a/CN/modules/ROOT/nav.adoc +++ b/CN/modules/ROOT/nav.adoc @@ -14,6 +14,7 @@ *** xref:master/4.5.adoc[迁移指南] ** IvorySQL生态 *** xref:master/5.0.adoc[概述] +*** xref:master/5.1.adoc[postgis] *** xref:master/5.2.adoc[pgvector] *** xref:master/5.3.adoc[pgddl(DDL Extractor)] *** xref:master/5.4.adoc[pg_cron] diff --git a/CN/modules/ROOT/pages/master/5.0.adoc b/CN/modules/ROOT/pages/master/5.0.adoc index 6ea7aa1d..87557592 100644 --- a/CN/modules/ROOT/pages/master/5.0.adoc +++ b/CN/modules/ROOT/pages/master/5.0.adoc @@ -12,6 +12,7 @@ IvorySQL 作为一款兼容 Oracle 且基于 PostgreSQL 的高级开源数据库 [cols="2,1,3,3"] |==== |*插件名称*|*版本*|*功能描述*|*适用场景* +| xref:master/5.1.adoc[postgis] | 3.5.4 | 为 IvorySQL 提供地理空间数据支持,包括空间索引、空间函数和地理对象存储 | 地理信息系统(GIS)、地图服务、位置数据分析 | xref:master/5.2.adoc[pgvector] | 0.8.1 | 支持向量相似性搜索,可用于存储和检索高维向量数据| AI 应用、图像检索、推荐系统、语义搜索 | xref:master/5.3.adoc[pgddl (DDL Extractor)] | 0.31 | 提取数据库中的 DDL(数据定义语言)语句,便于版本管理和迁移 | 数据库版本控制、CI/CD 集成、结构比对与同步 | xref:master/5.4.adoc[pg_cron]​ | 1.6.0 | 提供数据库内部的定时任务调度功能,支持定期执行SQL语句 | 数据清理、定期统计、自动化维护任务 diff --git a/CN/modules/ROOT/pages/master/5.1.adoc b/CN/modules/ROOT/pages/master/5.1.adoc index 197ec398..8c7a2238 100644 --- a/CN/modules/ROOT/pages/master/5.1.adoc +++ b/CN/modules/ROOT/pages/master/5.1.adoc @@ -11,107 +11,56 @@ IvorySQL原生100%兼容PostgreSQL,因此,PostGIS可以完美适配IvorySQL。 根据开发环境,用户可从 https://postgis.net/documentation/getting_started/#installing-postgis[PostGIS安装] 页面选择适合自己的方式进行安装PostGIS安装。 === 源码安装 -除PostGIS社区提供的安装方式以外,IvorySQL社区也提供了源码安装方式,源码安装环境为 CentOS Stream 9(x86_64)。 +除PostGIS社区提供的安装方式以外,IvorySQL社区也提供了源码安装方式,源码安装环境为 Ubuntu 24.04(x86_64)。 [NOTE] -请确保环境中已安装了**IvorySQL3.0及以上版本** +请确保环境中已安装了**IvorySQL5.0及以上版本** ** 安装依赖 -``` -dnf install -y gcc gcc-c++ libtiff libtiff-devel.x86_64 libcurl-devel.x86_64 libtool libxml2-devel redhat-rpm-config clang llvm geos311 automake protobuf-c-devel -``` - -** 安装SQLITE -``` -$ wget https://www.sqlite.org/2022/sqlite-autoconf-3400000.tar.gz -$ tar -xvf sqlite-autoconf-3400000.tar.gz -$ cd sqlite-autoconf-3400000 -$ sed -n '1i\#define SQLITE_ENABLE_COLUMN_METADATA 1' sqlite3.c -$ ./configure --prefix=/usr/local/sqlite -$ make && make install -$ rm usr/bin/sqlite3 && ln -s /usr/local/sqlite/bin/sqlite3 /usr/bin/sqlite3 -$ sqlite3 -version -$ export PKG_CONFIG_PATH=/usr/local/sqlite/lib/pkgconfig:$PKG_CONFIG_PATH -``` - -** 安装PROJ -``` -$ wget https://download.osgeo.org/proj/proj-8.2.1.tar.gz -$ tar -xvf proj-8.2.1.tar.gz -$ cd proj-8.2.1 -$ ./configure --prefix=/usr/local/proj-8.2.1 -$ make && make install -``` - -** 安装 GDAL -``` -$ wget https://github.com/OSGeo/gdal/releases/download/v3.4.3/gdal-3.4.3.tar.gz -$ tar -xvf gdal-3.4.3.tar.gz -$ cd gdal-3.4.3 -$ sh autogen.sh -$ ./configure --prefix=/usr/local/gdal-3.4.3 --with-proj=/usr/local/proj-8.2.1 -$ make && make install -``` - -** 安装 GEOS -``` -$ wget https://download.osgeo.org/geos/geos-3.9.2.tar.bz2 -$ tar -xvf geos-3.9.2.tar.bz2 -$ cd geos-3.9.2 -$ ./configure --prefix=/usr/local/geos-3.9.2 -$ make && make install -``` - -** 安装 Protobuf -``` -$ wget https://plug-neomirror.rcac.purdue.edu/adelie/source/archive/protobuf-3.20.1/protobuf-3.20.1.tar.gz -$ tar -xvf protobuf-3.20.1.tar.gz -$ cd protobuf-3.20.1 -$ sh autogen.sh -$ ./configure  --prefix=/usr/local/protobuf-3.20.1 -$ make && make install -$ export PROTOBUF_HOME=/usr/local/protobuf-3.20.1 -$ export PATH=$PROTOBUF_HOME/bin:$PATH -$ export PKG_CONFIG_PATH=$PROTOBUF_HOME/lib/pkgconfig:$PKG_CONFIG_PATH -``` - -** 安装 Protobuf-c -``` -$ wget --no-check-certificate https://sources.buildroot.net/protobuf-c/protobuf-c-1.4.1.tar.gz -$ tar -xvf protobuf-c-1.4.1.tar.gz -$ cd protobuf-c-1.4.1 -$ ./configure --prefix=/usr/local/protobuf-c-1.4.1 -$ make && make install -$ export PROTOBUFC_HOME=/usr/local/protobuf-c-1.4.1 -$ export PATH=$PROTOBUF_HOME/bin:$PROTOBUFC_HOME/bin:$PATH -$ export PKG_CONFIG_PATH=$PROTOBUFC_HOME/lib:$PKG_CONFIG_PATH -``` +[literal] +---- +sudo apt install \ + docbook-xsl-ns \ + gettext \ + libgdal-dev \ + libgeos-dev \ + libjson-c-dev \ + libproj-dev \ + libprotobuf-c-dev \ + libsfcgal-dev \ + libxml2-dev \ + libxml2-utils \ + protobuf-c-compiler \ + xsltproc +---- ** 安装 PostGIS -``` -$ wget https://download.osgeo.org/postgis/source/postgis-3.4.0.tar.gz -$ tar -xvf postgis-3.4.0.tar.gz -$ cd postgis-3.4.0 -$ sh autogen.sh -$ ./configure --with-geosconfig=/usr/local/geos-3.9.2/bin/geos-config --with-projdir=/usr/local/proj-8.2.1 --with-gdalconfig=/usr/local/gdal-3.4.3/bin/gdal-config --with-protobufdir=/usr/local/protobuf-c-1.4.1 --with-pgconfig=/usr/local/ivorysql/ivorysql-4/bin/pg_config -$ make && make install -``` +[literal] +---- +$ wget https://download.osgeo.org/postgis/source/postgis-3.5.4.tar.gz +$ tar xvf postgis-3.5.4.tar.gz +$ cd postgis-3.5.4 +$ ./configure --with-pgconfig=/path/to/pg_config eg: /opt/IvorySQL-5/bin/pg_config,如果ivorysql安装目录在/opt/IvorySQL-5. +$ make +$ sudo make install +---- [TIP] 如出现PGXS报错, 请根据环境中IvorySQL安装路径, 修改--with-pgconfig的参数值。 == 创建Extension并确认PostGIS版本 psql 连接到数据库,执行如下命令: -``` +[literal] +---- ivorysql=# CREATE extension postgis; CREATE EXTENSION ivorysql=# SELECT * FROM pg_available_extensions WHERE name = 'postgis'; name | default_version | installed_version | comment ---------+-----------------+-------------------+------------------------------------------------------------ - postgis | 3.4.0 | 3.4.0 | PostGIS geometry and geography spatial types and functions + postgis | 3.5.4 | 3.5.4 | PostGIS geometry and geography spatial types and functions (1 row) -``` +---- == 使用 -关于PostGIS的使用,请参阅 https://postgis.net/docs/manual-3.4[PostGIS3.4官方文档] \ No newline at end of file +关于PostGIS的使用,请参阅 https://postgis.net/docs/manual-3.5[PostGIS3.5官方文档] \ No newline at end of file diff --git a/EN/modules/ROOT/nav.adoc b/EN/modules/ROOT/nav.adoc index d5fa57f4..f0aef7d7 100644 --- a/EN/modules/ROOT/nav.adoc +++ b/EN/modules/ROOT/nav.adoc @@ -12,7 +12,8 @@ ** xref:master/4.4.adoc[Operation Management] ** xref:master/4.5.adoc[Migration] * IvorySQL Ecosystem -** xref:master/5.0.adoc[Overview] +** xref:master/5.0.adoc[Overview] +** xref:master/5.1.adoc[postgis] ** xref:master/5.2.adoc[pgvector] ** xref:master/5.3.adoc[pgddl(DDL Extractor)] ** xref:master/5.4.adoc[pg_cron] diff --git a/EN/modules/ROOT/pages/master/5.0.adoc b/EN/modules/ROOT/pages/master/5.0.adoc index 437b44cd..f31980b0 100644 --- a/EN/modules/ROOT/pages/master/5.0.adoc +++ b/EN/modules/ROOT/pages/master/5.0.adoc @@ -12,6 +12,7 @@ IvorySQL, as an advanced open-source database compatible with Oracle and based o [cols="2,1,3,3"] |==== |*Plugin Name*|*Version*|*Function Description*|*Use Cases* +| xref:master/5.1.adoc[postgis] | 3.5.4 | Provides geospatial data support for IvorySQL, including spatial indexes, spatial functions, and geographic object storage | Geographic Information Systems (GIS), map services, location data analysis | xref:master/5.2.adoc[pgvector] | 0.8.1 | Supports vector similarity search, can be used to store and retrieve high-dimensional vector data| AI applications, image retrieval, recommendation systems, semantic search | xref:master/5.3.adoc[pgddl (DDL Extractor)] | 0.31 | Extracts DDL (Data Definition Language) statements from databases, facilitating version management and migration | Database version control, CI/CD integration, structure comparison and synchronization | xref:master/5.4.adoc[pg_cron]​ | 1.6.0 | Provides database-internal scheduled task scheduling functionality, supports regular SQL statement execution | Data cleanup, regular statistics, automated maintenance tasks diff --git a/EN/modules/ROOT/pages/master/5.1.adoc b/EN/modules/ROOT/pages/master/5.1.adoc index 3de0d297..9a723e40 100644 --- a/EN/modules/ROOT/pages/master/5.1.adoc +++ b/EN/modules/ROOT/pages/master/5.1.adoc @@ -11,108 +11,56 @@ IvorySQL is fully compatible with PostgreSQL, allowing for seamless integration Users can select the installation method for PostGIS that best suits their development environment from the https://postgis.net/documentation/getting_started/#installing-postgis[PostGIS installation page]. === Source Code Installation -Apart from the installation methods provided by the PostGIS community, the IvorySQL community also offers a source code installation method, with CentOS Stream 9 (x86_64) as the environment for source code installation. +In addition to the installation methods provided by the PostGIS community, the IvorySQL community also offers a source code installation method, with Ubuntu 24.04 (x86_64) as the installation environment. [NOTE] -Please make sure that IvorySQL version 3.0 or newer is installed in the environment. +Please ensure that **IvorySQL 5.0 or above** is installed in the environment. ** Install dependencies -``` -dnf install -y gcc gcc-c++ libtiff libtiff-devel.x86_64 libcurl-devel.x86_64 libtool libxml2-devel redhat-rpm-config clang llvm geos311 automake protobuf-c-devel -``` - -** Install SQLITE -``` -$ wget https://www.sqlite.org/2022/sqlite-autoconf-3400000.tar.gz -$ tar -xvf sqlite-autoconf-3400000.tar.gz -$ cd sqlite-autoconf-3400000 -$ sed -n '1i\#define SQLITE_ENABLE_COLUMN_METADATA 1' sqlite3.c -$ ./configure --prefix=/usr/local/sqlite -$ make && make install -$ rm usr/bin/sqlite3 && ln -s /usr/local/sqlite/bin/sqlite3 /usr/bin/sqlite3 -$ sqlite3 -version -$ export PKG_CONFIG_PATH=/usr/local/sqlite/lib/pkgconfig:$PKG_CONFIG_PATH -``` - -** Install PROJ -``` -$ wget https://download.osgeo.org/proj/proj-8.2.1.tar.gz -$ tar -xvf proj-8.2.1.tar.gz -$ cd proj-8.2.1 -$ ./configure --prefix=/usr/local/proj-8.2.1 -$ make && make install -``` - -** Install GDAL -``` -$ wget https://github.com/OSGeo/gdal/releases/download/v3.4.3/gdal-3.4.3.tar.gz -$ tar -xvf gdal-3.4.3.tar.gz -$ cd gdal-3.4.3 -$ sh autogen.sh -$ ./configure --prefix=/usr/local/gdal-3.4.3 --with-proj=/usr/local/proj-8.2.1 -$ make && make install -``` - -** Install GEOS -``` -$ wget https://download.osgeo.org/geos/geos-3.9.2.tar.bz2 -$ tar -xvf geos-3.9.2.tar.bz2 -$ cd geos-3.9.2 -$ ./configure --prefix=/usr/local/geos-3.9.2 -$ make && make install -``` - -** Install Protobuf -``` -$ wget https://plug-neomirror.rcac.purdue.edu/adelie/source/archive/protobuf-3.20.1/protobuf-3.20.1.tar.gz -$ tar -xvf protobuf-3.20.1.tar.gz -$ cd protobuf-3.20.1 -$ sh autogen.sh -$ ./configure --prefix=/usr/local/protobuf-3.20.1 -$ make && make install -$ export PROTOBUF_HOME=/usr/local/protobuf-3.20.1 -$ export PATH=$PROTOBUF_HOME/bin:$PATH -$ export PKG_CONFIG_PATH=$PROTOBUF_HOME/lib/pkgconfig:$PKG_CONFIG_PATH -``` - -** Install Protobuf-c -``` -$ wget --no-check-certificate https://sources.buildroot.net/protobuf-c/protobuf-c-1.4.1.tar.gz -$ tar -xvf protobuf-c-1.4.1.tar.gz -$ cd protobuf-c-1.4.1 -$ ./configure --prefix=/usr/local/protobuf-c-1.4.1 -$ make && make install -$ export PROTOBUFC_HOME=/usr/local/protobuf-c-1.4.1 -$ export PATH=$PROTOBUF_HOME/bin:$PROTOBUFC_HOME/bin:$PATH -$ export PKG_CONFIG_PATH=$PROTOBUFC_HOME/lib:$PKG_CONFIG_PATH -``` +[literal] +---- +sudo apt install \ + docbook-xsl-ns \ + gettext \ + libgdal-dev \ + libgeos-dev \ + libjson-c-dev \ + libproj-dev \ + libprotobuf-c-dev \ + libsfcgal-dev \ + libxml2-dev \ + libxml2-utils \ + protobuf-c-compiler \ + xsltproc +---- ** Install PostGIS -``` -$ wget https://download.osgeo.org/postgis/source/postgis-3.4.0.tar.gz -$ tar -xvf postgis-3.4.0.tar.gz -$ cd postgis-3.4.0 -$ sh autogen.sh -$ ./configure --with-geosconfig=/usr/local/geos-3.9.2/bin/geos-config --with-projdir=/usr/local/proj-8.2.1 --with-gdalconfig=/usr/local/gdal-3.4.3/bin/gdal-config --with-protobufdir=/usr/local/protobuf-c-1.4.1 --with-pgconfig=/usr/local/ivorysql/ivorysql-4/bin/pg_config -$ make && make install -``` +[literal] +---- +$ wget https://download.osgeo.org/postgis/source/postgis-3.5.4.tar.gz +$ tar xvf postgis-3.5.4.tar.gz +$ cd postgis-3.5.4 +$ ./configure --with-pgconfig=/path/to/pg_config eg: /opt/IvorySQL-5/bin/pg_config, if ivorysql installation directory is /opt/IvorySQL-5. +$ make +$ sudo make install +---- [TIP] If configure reports PGXS error, please change --with-pgconfig parameter value and confirm the parameter value based on the installation path of IvorySQL in the environment. -== Create the extension and verify the PostGIS version. - -Connect to the database with psql and execute the following command: +== Create Extension and Verify PostGIS Version -``` +Connect to the database with psql and execute the following commands: +[literal] +---- ivorysql=# CREATE extension postgis; CREATE EXTENSION ivorysql=# SELECT * FROM pg_available_extensions WHERE name = 'postgis'; name | default_version | installed_version | comment ---------+-----------------+-------------------+------------------------------------------------------------ - postgis | 3.4.0 | 3.4.0 | PostGIS geometry and geography spatial types and functions + postgis | 3.5.4 | 3.5.4 | PostGIS geometry and geography spatial types and functions (1 row) -``` +---- == Using -To learn more about using PostGIS, please consult the official https://postgis.net/docs/manual-3.4[documentation for PostGIS 3.4]. \ No newline at end of file +For information about using PostGIS, please refer to the https://postgis.net/docs/manual-3.5[PostGIS 3.5 Official Documentation] From d3077835d3ad98af7514d8cc6a6ff74cc01262a5 Mon Sep 17 00:00:00 2001 From: yuan li Date: Wed, 5 Nov 2025 14:39:07 +0800 Subject: [PATCH 2/2] adjust format --- CN/modules/ROOT/pages/master/5.1.adoc | 1 + EN/modules/ROOT/pages/master/5.1.adoc | 1 + 2 files changed, 2 insertions(+) diff --git a/CN/modules/ROOT/pages/master/5.1.adoc b/CN/modules/ROOT/pages/master/5.1.adoc index 8c7a2238..a8a4ab1d 100644 --- a/CN/modules/ROOT/pages/master/5.1.adoc +++ b/CN/modules/ROOT/pages/master/5.1.adoc @@ -35,6 +35,7 @@ sudo apt install \ ---- ** 安装 PostGIS ++ [literal] ---- $ wget https://download.osgeo.org/postgis/source/postgis-3.5.4.tar.gz diff --git a/EN/modules/ROOT/pages/master/5.1.adoc b/EN/modules/ROOT/pages/master/5.1.adoc index 9a723e40..be2d8362 100644 --- a/EN/modules/ROOT/pages/master/5.1.adoc +++ b/EN/modules/ROOT/pages/master/5.1.adoc @@ -35,6 +35,7 @@ sudo apt install \ ---- ** Install PostGIS ++ [literal] ---- $ wget https://download.osgeo.org/postgis/source/postgis-3.5.4.tar.gz