Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CN/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
1 change: 1 addition & 0 deletions CN/modules/ROOT/pages/master/5.0.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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语句 | 数据清理、定期统计、自动化维护任务
Expand Down
116 changes: 33 additions & 83 deletions CN/modules/ROOT/pages/master/5.1.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,107 +11,57 @@ 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官方文档]
关于PostGIS的使用,请参阅 https://postgis.net/docs/manual-3.5[PostGIS3.5官方文档]
1 change: 1 addition & 0 deletions EN/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
** xref:master/4.5.adoc[Migration]
* IvorySQL Ecosystem
** 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]
Expand Down
1 change: 1 addition & 0 deletions EN/modules/ROOT/pages/master/5.0.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
121 changes: 35 additions & 86 deletions EN/modules/ROOT/pages/master/5.1.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,108 +11,57 @@ 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].
For information about using PostGIS, please refer to the https://postgis.net/docs/manual-3.5[PostGIS 3.5 Official Documentation]