Skip to content

Commit e13129a

Browse files
authored
Merge pull request #186 from yuanyl630/postgis
modify document for postgis extension
2 parents 2fb11a9 + a9d2522 commit e13129a

File tree

6 files changed

+72
-169
lines changed

6 files changed

+72
-169
lines changed

CN/modules/ROOT/nav.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
*** xref:master/4.5.adoc[迁移指南]
1515
** IvorySQL生态
1616
*** xref:master/5.0.adoc[概述]
17+
*** xref:master/5.1.adoc[postgis]
1718
*** xref:master/5.2.adoc[pgvector]
1819
*** xref:master/5.3.adoc[pgddl(DDL Extractor)]
1920
*** xref:master/5.4.adoc[pg_cron]

CN/modules/ROOT/pages/master/5.0.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ IvorySQL 作为一款兼容 Oracle 且基于 PostgreSQL 的高级开源数据库
1212
[cols="2,1,3,3"]
1313
|====
1414
|*插件名称*|*版本*|*功能描述*|*适用场景*
15+
| xref:master/5.1.adoc[postgis] | 3.5.4 | 为 IvorySQL 提供地理空间数据支持,包括空间索引、空间函数和地理对象存储 | 地理信息系统(GIS)、地图服务、位置数据分析
1516
| xref:master/5.2.adoc[pgvector] | 0.8.1 | 支持向量相似性搜索,可用于存储和检索高维向量数据| AI 应用、图像检索、推荐系统、语义搜索
1617
| xref:master/5.3.adoc[pgddl (DDL Extractor)] | 0.31 | 提取数据库中的 DDL(数据定义语言)语句,便于版本管理和迁移 | 数据库版本控制、CI/CD 集成、结构比对与同步
1718
| xref:master/5.4.adoc[pg_cron]​ | 1.6.0 | 提供数据库内部的定时任务调度功能,支持定期执行SQL语句 | 数据清理、定期统计、自动化维护任务

CN/modules/ROOT/pages/master/5.1.adoc

Lines changed: 33 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -11,107 +11,57 @@ IvorySQL原生100%兼容PostgreSQL,因此,PostGIS可以完美适配IvorySQL。
1111
根据开发环境,用户可从 https://postgis.net/documentation/getting_started/#installing-postgis[PostGIS安装] 页面选择适合自己的方式进行安装PostGIS安装。
1212

1313
=== 源码安装
14-
除PostGIS社区提供的安装方式以外,IvorySQL社区也提供了源码安装方式,源码安装环境为 CentOS Stream 9(x86_64)。
14+
除PostGIS社区提供的安装方式以外,IvorySQL社区也提供了源码安装方式,源码安装环境为 Ubuntu 24.04(x86_64)。
1515

1616
[NOTE]
17-
请确保环境中已安装了**IvorySQL3.0及以上版本**
17+
请确保环境中已安装了**IvorySQL5.0及以上版本**
1818

1919
** 安装依赖
20-
```
21-
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
22-
```
23-
24-
** 安装SQLITE
25-
```
26-
$ wget https://www.sqlite.org/2022/sqlite-autoconf-3400000.tar.gz
27-
$ tar -xvf sqlite-autoconf-3400000.tar.gz
28-
$ cd sqlite-autoconf-3400000
29-
$ sed -n '1i\#define SQLITE_ENABLE_COLUMN_METADATA 1' sqlite3.c
30-
$ ./configure --prefix=/usr/local/sqlite
31-
$ make && make install
32-
$ rm usr/bin/sqlite3 && ln -s /usr/local/sqlite/bin/sqlite3 /usr/bin/sqlite3
33-
$ sqlite3 -version
34-
$ export PKG_CONFIG_PATH=/usr/local/sqlite/lib/pkgconfig:$PKG_CONFIG_PATH
35-
```
36-
37-
** 安装PROJ
38-
```
39-
$ wget https://download.osgeo.org/proj/proj-8.2.1.tar.gz
40-
$ tar -xvf proj-8.2.1.tar.gz
41-
$ cd proj-8.2.1
42-
$ ./configure --prefix=/usr/local/proj-8.2.1
43-
$ make && make install
44-
```
45-
46-
** 安装 GDAL
47-
```
48-
$ wget https://github.com/OSGeo/gdal/releases/download/v3.4.3/gdal-3.4.3.tar.gz
49-
$ tar -xvf gdal-3.4.3.tar.gz
50-
$ cd gdal-3.4.3
51-
$ sh autogen.sh
52-
$ ./configure --prefix=/usr/local/gdal-3.4.3 --with-proj=/usr/local/proj-8.2.1
53-
$ make && make install
54-
```
55-
56-
** 安装 GEOS
57-
```
58-
$ wget https://download.osgeo.org/geos/geos-3.9.2.tar.bz2
59-
$ tar -xvf geos-3.9.2.tar.bz2
60-
$ cd geos-3.9.2
61-
$ ./configure --prefix=/usr/local/geos-3.9.2
62-
$ make && make install
63-
```
64-
65-
** 安装 Protobuf
66-
```
67-
$ wget https://plug-neomirror.rcac.purdue.edu/adelie/source/archive/protobuf-3.20.1/protobuf-3.20.1.tar.gz
68-
$ tar -xvf protobuf-3.20.1.tar.gz
69-
$ cd protobuf-3.20.1
70-
$ sh autogen.sh
71-
$ ./configure  --prefix=/usr/local/protobuf-3.20.1
72-
$ make && make install
73-
$ export PROTOBUF_HOME=/usr/local/protobuf-3.20.1
74-
$ export PATH=$PROTOBUF_HOME/bin:$PATH
75-
$ export PKG_CONFIG_PATH=$PROTOBUF_HOME/lib/pkgconfig:$PKG_CONFIG_PATH
76-
```
77-
78-
** 安装 Protobuf-c
79-
```
80-
$ wget --no-check-certificate https://sources.buildroot.net/protobuf-c/protobuf-c-1.4.1.tar.gz
81-
$ tar -xvf protobuf-c-1.4.1.tar.gz
82-
$ cd protobuf-c-1.4.1
83-
$ ./configure --prefix=/usr/local/protobuf-c-1.4.1
84-
$ make && make install
85-
$ export PROTOBUFC_HOME=/usr/local/protobuf-c-1.4.1
86-
$ export PATH=$PROTOBUF_HOME/bin:$PROTOBUFC_HOME/bin:$PATH
87-
$ export PKG_CONFIG_PATH=$PROTOBUFC_HOME/lib:$PKG_CONFIG_PATH
88-
```
20+
[literal]
21+
----
22+
sudo apt install \
23+
docbook-xsl-ns \
24+
gettext \
25+
libgdal-dev \
26+
libgeos-dev \
27+
libjson-c-dev \
28+
libproj-dev \
29+
libprotobuf-c-dev \
30+
libsfcgal-dev \
31+
libxml2-dev \
32+
libxml2-utils \
33+
protobuf-c-compiler \
34+
xsltproc
35+
----
8936

9037
** 安装 PostGIS
91-
```
92-
$ wget https://download.osgeo.org/postgis/source/postgis-3.4.0.tar.gz
93-
$ tar -xvf postgis-3.4.0.tar.gz
94-
$ cd postgis-3.4.0
95-
$ sh autogen.sh
96-
$ ./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
97-
$ make && make install
98-
```
38+
+
39+
[literal]
40+
----
41+
$ wget https://download.osgeo.org/postgis/source/postgis-3.5.4.tar.gz
42+
$ tar xvf postgis-3.5.4.tar.gz
43+
$ cd postgis-3.5.4
44+
$ ./configure --with-pgconfig=/path/to/pg_config eg: /opt/IvorySQL-5/bin/pg_config,如果ivorysql安装目录在/opt/IvorySQL-5.
45+
$ make
46+
$ sudo make install
47+
----
9948
[TIP]
10049
如出现PGXS报错, 请根据环境中IvorySQL安装路径, 修改--with-pgconfig的参数值。
10150

10251
== 创建Extension并确认PostGIS版本
10352

10453
psql 连接到数据库,执行如下命令:
105-
```
54+
[literal]
55+
----
10656
ivorysql=# CREATE extension postgis;
10757
CREATE EXTENSION
10858
10959
ivorysql=# SELECT * FROM pg_available_extensions WHERE name = 'postgis';
11060
name | default_version | installed_version | comment
11161
---------+-----------------+-------------------+------------------------------------------------------------
112-
postgis | 3.4.0 | 3.4.0 | PostGIS geometry and geography spatial types and functions
62+
postgis | 3.5.4 | 3.5.4 | PostGIS geometry and geography spatial types and functions
11363
(1 row)
114-
```
64+
----
11565

11666
== 使用
117-
关于PostGIS的使用,请参阅 https://postgis.net/docs/manual-3.4[PostGIS3.4官方文档]
67+
关于PostGIS的使用,请参阅 https://postgis.net/docs/manual-3.5[PostGIS3.5官方文档]

EN/modules/ROOT/nav.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
** xref:master/4.5.adoc[Migration]
1414
* IvorySQL Ecosystem
1515
** xref:master/5.0.adoc[Overview]
16+
** xref:master/5.1.adoc[postgis]
1617
** xref:master/5.2.adoc[pgvector]
1718
** xref:master/5.3.adoc[pgddl(DDL Extractor)]
1819
** xref:master/5.4.adoc[pg_cron]

EN/modules/ROOT/pages/master/5.0.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ IvorySQL, as an advanced open-source database compatible with Oracle and based o
1212
[cols="2,1,3,3"]
1313
|====
1414
|*Plugin Name*|*Version*|*Function Description*|*Use Cases*
15+
| 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
1516
| 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
1617
| 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
1718
| 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

EN/modules/ROOT/pages/master/5.1.adoc

Lines changed: 35 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -11,108 +11,57 @@ IvorySQL is fully compatible with PostgreSQL, allowing for seamless integration
1111
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].
1212

1313
=== Source Code Installation
14-
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.
14+
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.
1515

1616
[NOTE]
17-
Please make sure that IvorySQL version 3.0 or newer is installed in the environment.
17+
Please ensure that **IvorySQL 5.0 or above** is installed in the environment.
1818

1919
** Install dependencies
20-
```
21-
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
22-
```
23-
24-
** Install SQLITE
25-
```
26-
$ wget https://www.sqlite.org/2022/sqlite-autoconf-3400000.tar.gz
27-
$ tar -xvf sqlite-autoconf-3400000.tar.gz
28-
$ cd sqlite-autoconf-3400000
29-
$ sed -n '1i\#define SQLITE_ENABLE_COLUMN_METADATA 1' sqlite3.c
30-
$ ./configure --prefix=/usr/local/sqlite
31-
$ make && make install
32-
$ rm usr/bin/sqlite3 && ln -s /usr/local/sqlite/bin/sqlite3 /usr/bin/sqlite3
33-
$ sqlite3 -version
34-
$ export PKG_CONFIG_PATH=/usr/local/sqlite/lib/pkgconfig:$PKG_CONFIG_PATH
35-
```
36-
37-
** Install PROJ
38-
```
39-
$ wget https://download.osgeo.org/proj/proj-8.2.1.tar.gz
40-
$ tar -xvf proj-8.2.1.tar.gz
41-
$ cd proj-8.2.1
42-
$ ./configure --prefix=/usr/local/proj-8.2.1
43-
$ make && make install
44-
```
45-
46-
** Install GDAL
47-
```
48-
$ wget https://github.com/OSGeo/gdal/releases/download/v3.4.3/gdal-3.4.3.tar.gz
49-
$ tar -xvf gdal-3.4.3.tar.gz
50-
$ cd gdal-3.4.3
51-
$ sh autogen.sh
52-
$ ./configure --prefix=/usr/local/gdal-3.4.3 --with-proj=/usr/local/proj-8.2.1
53-
$ make && make install
54-
```
55-
56-
** Install GEOS
57-
```
58-
$ wget https://download.osgeo.org/geos/geos-3.9.2.tar.bz2
59-
$ tar -xvf geos-3.9.2.tar.bz2
60-
$ cd geos-3.9.2
61-
$ ./configure --prefix=/usr/local/geos-3.9.2
62-
$ make && make install
63-
```
64-
65-
** Install Protobuf
66-
```
67-
$ wget https://plug-neomirror.rcac.purdue.edu/adelie/source/archive/protobuf-3.20.1/protobuf-3.20.1.tar.gz
68-
$ tar -xvf protobuf-3.20.1.tar.gz
69-
$ cd protobuf-3.20.1
70-
$ sh autogen.sh
71-
$ ./configure --prefix=/usr/local/protobuf-3.20.1
72-
$ make && make install
73-
$ export PROTOBUF_HOME=/usr/local/protobuf-3.20.1
74-
$ export PATH=$PROTOBUF_HOME/bin:$PATH
75-
$ export PKG_CONFIG_PATH=$PROTOBUF_HOME/lib/pkgconfig:$PKG_CONFIG_PATH
76-
```
77-
78-
** Install Protobuf-c
79-
```
80-
$ wget --no-check-certificate https://sources.buildroot.net/protobuf-c/protobuf-c-1.4.1.tar.gz
81-
$ tar -xvf protobuf-c-1.4.1.tar.gz
82-
$ cd protobuf-c-1.4.1
83-
$ ./configure --prefix=/usr/local/protobuf-c-1.4.1
84-
$ make && make install
85-
$ export PROTOBUFC_HOME=/usr/local/protobuf-c-1.4.1
86-
$ export PATH=$PROTOBUF_HOME/bin:$PROTOBUFC_HOME/bin:$PATH
87-
$ export PKG_CONFIG_PATH=$PROTOBUFC_HOME/lib:$PKG_CONFIG_PATH
88-
```
20+
[literal]
21+
----
22+
sudo apt install \
23+
docbook-xsl-ns \
24+
gettext \
25+
libgdal-dev \
26+
libgeos-dev \
27+
libjson-c-dev \
28+
libproj-dev \
29+
libprotobuf-c-dev \
30+
libsfcgal-dev \
31+
libxml2-dev \
32+
libxml2-utils \
33+
protobuf-c-compiler \
34+
xsltproc
35+
----
8936

9037
** Install PostGIS
91-
```
92-
$ wget https://download.osgeo.org/postgis/source/postgis-3.4.0.tar.gz
93-
$ tar -xvf postgis-3.4.0.tar.gz
94-
$ cd postgis-3.4.0
95-
$ sh autogen.sh
96-
$ ./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
97-
$ make && make install
98-
```
38+
+
39+
[literal]
40+
----
41+
$ wget https://download.osgeo.org/postgis/source/postgis-3.5.4.tar.gz
42+
$ tar xvf postgis-3.5.4.tar.gz
43+
$ cd postgis-3.5.4
44+
$ ./configure --with-pgconfig=/path/to/pg_config eg: /opt/IvorySQL-5/bin/pg_config, if ivorysql installation directory is /opt/IvorySQL-5.
45+
$ make
46+
$ sudo make install
47+
----
9948
[TIP]
10049
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.
10150

102-
== Create the extension and verify the PostGIS version.
103-
104-
Connect to the database with psql and execute the following command:
51+
== Create Extension and Verify PostGIS Version
10552

106-
```
53+
Connect to the database with psql and execute the following commands:
54+
[literal]
55+
----
10756
ivorysql=# CREATE extension postgis;
10857
CREATE EXTENSION
10958
11059
ivorysql=# SELECT * FROM pg_available_extensions WHERE name = 'postgis';
11160
name | default_version | installed_version | comment
11261
---------+-----------------+-------------------+------------------------------------------------------------
113-
postgis | 3.4.0 | 3.4.0 | PostGIS geometry and geography spatial types and functions
62+
postgis | 3.5.4 | 3.5.4 | PostGIS geometry and geography spatial types and functions
11463
(1 row)
115-
```
64+
----
11665

11766
== Using
118-
To learn more about using PostGIS, please consult the official https://postgis.net/docs/manual-3.4[documentation for PostGIS 3.4].
67+
For information about using PostGIS, please refer to the https://postgis.net/docs/manual-3.5[PostGIS 3.5 Official Documentation]

0 commit comments

Comments
 (0)