更新 部署PostGIS.md

This commit is contained in:
8ga
2026-03-02 14:04:38 +08:00
parent dae6821286
commit 4619617781

View File

@@ -151,22 +151,30 @@ INSERT INTO articles (title, content) VALUES
('AI 技术展望', '人工智能 (AI) 正在改变世界PostgreSQL 是存储这些数据的首选数据库。'), ('AI 技术展望', '人工智能 (AI) 正在改变世界PostgreSQL 是存储这些数据的首选数据库。'),
('PostgreSQL 16 新特性', 'PostgreSQL 16 带来了更好的性能,支持 JSON 增强和中文分词优化。'), ('PostgreSQL 16 新特性', 'PostgreSQL 16 带来了更好的性能,支持 JSON 增强和中文分词优化。'),
('日常开发笔记', 'Today I learned about zhparser. 它让中文搜索变得很简单。'); ('日常开发笔记', 'Today I learned about zhparser. 它让中文搜索变得很简单。');
```
```sql
-- 搜索包含 "人工智能" 的文章 -- 搜索包含 "人工智能" 的文章
SELECT title, content SELECT title, content
FROM articles FROM articles
WHERE content_tsvector @@ to_tsquery('chinese_mix', '人工智能'); WHERE content_tsvector @@ to_tsquery('chinese_mix', '人工智能');
```
```sql
-- 搜索包含 "PostgreSQL" 的文章 -- 搜索包含 "PostgreSQL" 的文章
SELECT title, content SELECT title, content
FROM articles FROM articles
WHERE content_tsvector @@ to_tsquery('chinese_mix', 'PostgreSQL'); WHERE content_tsvector @@ to_tsquery('chinese_mix', 'PostgreSQL');
```
```sql
-- 搜索既包含 "数据库" 又包含 "PostgreSQL" 的文章 -- 搜索既包含 "数据库" 又包含 "PostgreSQL" 的文章
SELECT title, content SELECT title, content
FROM articles FROM articles
WHERE content_tsvector @@ to_tsquery('chinese_mix', '数据库 & PostgreSQL'); WHERE content_tsvector @@ to_tsquery('chinese_mix', '数据库 & PostgreSQL');
```
```sql
-- 搜索包含 "AI" 或者 "改变" 的文章 -- 搜索包含 "AI" 或者 "改变" 的文章
SELECT title, content SELECT title, content
FROM articles FROM articles