SELECT
功能描述
SELECT用于从表或视图中取出数据。
SELECT语句就像叠加在数据库表上的过滤器,利用SQL关键字从数据表中过滤出用户需要的数据。
注意事项
- 对比原openGauss的SELECT语法,新增了WHERE子句下的sounds like语法。
- 新增join不带on/using,效果与cross join一致。
- 新增PARTITION子句可指定多个分区。
- 新增UNION子句列如果没有相似的数据类型,会采取转换为text类型的方式进行处理。
- 新增FROM DUAL 语法,含义等同于不写FROM子句,是为了满足那些要求所有SELECT语句都应该包含FROM的情况。
语法格式
- 查询数据
1. [ WITH [ RECURSIVE ] with_query [, ...] ]
2. SELECT [/*+ plan_hint */] [ ALL | DISTINCT [ ON ( expression [, ...] ) ] ]
3. { * | {expression [ [ AS ] output_name ]} [, ...] }
4. [ FROM from_item [, ...] ]
5. [ WHERE condition ]
6. [ [ START WITH condition ] CONNECT BY [NOCYCLE] condition [ ORDER SIBLINGS BY expression ] ]
7. [ GROUP BY grouping_element [, ...] ]
8. [ HAVING condition [, ...] ]
9. [ WINDOW {window_name AS ( window_definition )} [, ...] ]
10. [ { UNION | INTERSECT | EXCEPT | MINUS } [ ALL | DISTINCT ] select ]
11. [ ORDER BY {expression [ [ ASC | DESC | USING operator ] | nlssort_expression_clause ] [ NULLS { FIRST | LAST } ]} [, ...] ]
12. [ LIMIT { [offset,] count | ALL } ]
13. [ OFFSET start [ ROW | ROWS ] ]
14. [ FETCH { FIRST | NEXT } [ count ] { ROW | ROWS } ONLY ]
15. [ {FOR { UPDATE | NO KEY UPDATE | SHARE | KEY SHARE } [ OF table_name [, ...] ] [ NOWAIT ]} [...] ];
- 其中指定查询源from_item为:
1. {[ ONLY ] table_name [ * ] [ partition_clause ] [ [ AS ] alias [ ( column_alias [, ...] ) ] ]
2. [ TABLESAMPLE sampling_method ( argument [, ...] ) [ REPEATABLE ( seed ) ] ]
3. [TIMECAPSULE {TIMESTAMP|CSN} expression]
4. |( select ) [ AS ] alias [ ( column_alias [, ...] ) ]
5. |with_query_name [ [ AS ] alias [ ( column_alias [, ...] ) ] ]
6. |function_name ( [ argument [, ...] ] ) [ AS ] alias [ ( column_alias [, ...] | column_definition [, ...] ) ]
7. |function_name ( [ argument [, ...] ] ) AS ( column_definition [, ...] )
8. |from_item [ NATURAL ] join_type from_item [ ON join_condition | USING ( join_column [, ...] ) ]}
- 其中不写FROM 子句的情况等价于:
1. FROM DUAL
- 其中group子句为:
1. ( )
2. | expression
3. | ( expression [, ...] )
4. | rollup_clause
5. | CUBE ( { expression | ( expression [, ...] ) } [, ...] )
6. | GROUPING SETS ( grouping_element [, ...] )
- 其中指定分区partition_clause为:
1. PARTITION { ( partition_name [, ...] ) |
2. FOR ( partition_value [, ...] ) }
说明: 指定分区只适合分区表。
rollup_clause子句为:
1. ROLLUP ( { expression | ( expression [, ...] ) } [, ...] )
2. | { expression | ( expression [, ...] ) } WITH ROLLUP
- JOIN语法
1. [JOIN | INNER JOIN] {ON join_condition | USING ( join_column [, ...] ) }
参数说明
- WHERE子句
sounds like是condition的一种语法,用法如:column_name sounds like ‘字符’; 相当于soundex(column_name) = soundex(‘字符’)的对比结果,是一个boolean的值。用于通过soundex处理来查询满足条件的数据。
where 子句可以包含兼容MySQL全文索引的查询语法。match(column_name [, …]) against (‘匹配字符’)也是condition的一种语法。
1. where match(column_name [, ...]) against ('匹配字符');
column_name可以是多列,列名之间用逗号分隔。 against()的匹配字符只能是字符内容(即全文索引支持字段类型只能是这三种char, varchar, text),不包含int, bool, 特殊字符(!,#,空格等)与正规功能。 注意: mysql的全文索引查询语法match(column_name)允许无序,但该功能底层用的是opengauss的to_tsvector(),他的要求是字段顺序必须有序(与表的字段顺序一致)。
用于安装了dolphin插件,处于MySQL兼容性场景下的全文索引查询。其语法结构相当于
1. to_tsvector('ngram', col_name [|| col_name]) @@ to_tsquery('字符串')
- UNION子句 UNION计算多个SELECT语句返回行集合的并集。UNION内部的SELECT语句必须拥有相同数量的列,列如果没有相似的数据类型或者为UNKNOWN类型,会采取转换为text类型的方式进行处理。
UNION子句有如下约束条件:
- 除非声明了ALL子句,否则缺省的UNION结果不包含重复的行。
- 同一个SELECT语句中的多个UNION操作符是从左向右计算的,除非用圆括弧进行了标识。
- FOR UPDATE,FOR NO KEY UPDATE,FOR SHARE和FOR KEY SHARE不能在UNION的结果或输入中声明。
一般表达式:
select_statement UNION [ALL] select_statement
- select_statement可以是任何没有ORDER BY、LIMIT、FOR UPDATE,FOR NO KEY UPDATE,FOR SHARE或FOR KEY SHARE子句的SELECT语句。
- 如果用圆括弧包围,ORDER BY和LIMIT可以附着在子表达式里。
说明:
涉及的其它参数说明可见SELECT。
示例
- SOUNDS LIKE子句示例:同音字段查询
1. openGauss=# CREATE TABLE TEST(id int, name varchar);
2. openGauss=# INSERT INTO TEST VALUES(1, 'too');
3. openGauss=# SELECT * FROM TEST WHERE name SOUNDS LIKE 'two';
4. id | name
5. ----+------
6. 1 | too
7. (1 row)
- SELECT GROUP BY子句中使用ROLLUP
1. openGauss=# CREATE TABLESPACE t_tbspace ADD DATAFILE 'my_tablespace' ENGINE = test_engine;
2. CREATE TABLESPACE
3. openGauss=# CREATE TABLE t_with_rollup(id int, name varchar(20), area varchar(50), count int);
4. CREATE TABLE
5. openGauss=# INSERT INTO t_with_rollup values(1, 'a', 'A', 10);
6. INSERT 0 1
7. openGauss=# INSERT INTO t_with_rollup values(2, 'b', 'B', 15);
8. INSERT 0 1
9. openGauss=# INSERT INTO t_with_rollup values(2, 'b', 'B', 20);
10. INSERT 0 1
11. openGauss=# INSERT INTO t_with_rollup values(3, 'c', 'C', 50);
12. INSERT 0 1
13. openGauss=# INSERT INTO t_with_rollup values(3, 'c', 'C', 15);
14. INSERT 0 1
15. openGauss=# SELECT name, sum(count) FROM t_with_rollup GROUP BY ROLLUP(name);
16. name | sum
17. ------+-----
18. a | 10
19. b | 35
20. c | 65
21. | 110
22. (4 rows)
24. openGauss=# SELECT name, sum(count) FROM t_with_rollup GROUP BY (name) WITH ROLLUP;
25. name | sum
26. ------+-----
27. a | 10
28. b | 35
29. c | 65
30. | 110
31. (4 rows)
1. openGauss=# create table join_1(col1 int4, col2 int8);
3. openGauss=# create table join_2(col1 int4, col2 int8);
5. openGauss=# insert into join_1 values(1, 2), (3, 3);
7. openGauss=# insert into join_2 values(1, 1), (2, 3), (4, 4);
9. openGauss=# select join_1 join join_2;
11. col1 | col2 | col1 | col2
12. ------+------+------+------
13. 1 | 2 | 1 | 1
14. 1 | 2 | 2 | 3
15. 1 | 2 | 4 | 4
16. 3 | 3 | 1 | 1
17. 3 | 3 | 2 | 3
18. 3 | 3 | 4 | 4
20. openGauss=# select join_1 inner join join_2;
22. col1 | col2 | col1 | col2
23. ------+------+------+------
24. 1 | 2 | 1 | 1
25. 1 | 2 | 2 | 3
26. 1 | 2 | 4 | 4
27. 3 | 3 | 1 | 1
28. 3 | 3 | 2 | 3
29. 3 | 3 | 4 | 4
- SELECT 语句中使用FROM DUAL 示例
1. openGauss=# select 1 as col;
2. col
3. -----
4. 1
5. (1 row)
6. openGauss=# select 1 as col FROM DUAL;
7. col
8. -----
9. 1
10. (1 row)
- SELECT FROM PARTITION子句指定多个分区
1. openGauss=# create table multi_partition_select_test(C_INT INTEGER) partition by range(C_INT)
2. openGauss-# (
3. openGauss(# partition test_part1 values less than (400),
4. openGauss(# partition test_part2 values less than (700),
5. openGauss(# partition test_part3 values less than (1000)
6. openGauss(# );
7. CREATE TABLE
8. openGauss=# insert into multi_partition_select_test values(111);
9. INSERT 0 1
10. openGauss=# insert into multi_partition_select_test values(555);
11. INSERT 0 1
12. openGauss=# insert into multi_partition_select_test values(888);
13. INSERT 0 1
15. openGauss=# select a.* from multi_partition_select_test partition (test_part1, test_part2) a;
16. c_int
17. -------
18. 111
19. 555
20. (2 rows)
- UNION子句非相似数据类型按 TEXT 类型进行转换示例:
1. -- 首先创建兼容模式为B的数据库
2. CREATE DATABASE mydb WITH DBCOMPATIBILITY 'B';
3. \c mydb
5. -- 创建两个表并插入测试数据
6. CREATE TABLE tbl_date(col DATE);
7. INSERT INTO tbl_date VALUES('2000-02-16');
8. CREATE TABLE tbl_json(col JSON);
9. INSERT INTO tbl_json VALUES('{"id":1,"dbname":"openGauss","language":"C++"}');
11. -- UNION 查询,将会使用TEXT类型进行转换
12. SELECT * FROM tbl_date UNION SELECT * FROM tbl_json;
- 兼容MySQL兼容性全文索引语法查询,前提是兼容模式为B的数据库。
1. openGauss=# CREATE SCHEMA fulltext_test;
2. CREATE SCHEMA
3. openGauss=# set current_schema to 'fulltext_test';
4. SET
5. openGauss=# CREATE TABLE test (
6. openGauss(# id int unsigned auto_increment not null primary key,
7. openGauss(# title varchar,
8. openGauss(# boby text,
9. openGauss(# name name,
10. openGauss(# FULLTEXT (title, boby) WITH PARSER ngram
11. openGauss(# );
12. NOTICE: CREATE TABLE will create implicit sequence "test_id_seq" for serial column "test.id"
13. NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "test_pkey" for table "test"
14. CREATE TABLE
15. openGauss=# \d test
16. Table "fulltext_test.test"
17. Column | Type | Modifiers
18. --------+-------------------+-------------------------
19. id | uint4 | not null AUTO_INCREMENT
20. title | character varying |
21. boby | text |
22. name | name |
23. Indexes:
24. "test_pkey" PRIMARY KEY, btree (id) TABLESPACE pg_default
25. "test_to_tsvector_to_tsvector1_idx" gin (to_tsvector('ngram'::regconfig, title::text), to_tsvector('ngram'::regconfig, boby)) TABLESPACE pg_default
27. openGauss=# \d test_to_tsvector_to_tsvector1_idx
28. Index "fulltext_test.test_to_tsvector_to_tsvector1_idx"
29. Column | Type | Definition
30. --------------+------+----------------------------------------------
31. to_tsvector | text | to_tsvector('ngram'::regconfig, title::text)
32. to_tsvector1 | text | to_tsvector('ngram'::regconfig, boby)
33. gin, for table "fulltext_test.test"
35. openGauss=# DROP INDEX test_to_tsvector_to_tsvector1_idx;
36. DROP INDEX
37. openGauss=# ALTER TABLE test ADD FULLTEXT INDEX test_index_1 (title, boby) WITH PARSER ngram;
38. ALTER TABLE
39. openGauss=# DROP INDEX test_index_1;
40. DROP INDEX
41. openGauss=# CREATE FULLTEXT INDEX test_index_1 ON test (title, boby) WITH PARSER ngram;
42. CREATE INDEX
43. openGauss=# \d test_index_1
44. Index "fulltext_test.test_index_1"
45. Column | Type | Definition
46. --------------+------+----------------------------------------------
47. to_tsvector | text | to_tsvector('ngram'::regconfig, title::text)
48. to_tsvector1 | text | to_tsvector('ngram'::regconfig, boby)
49. gin, for table "fulltext_test.test"
51. openGauss=# INSERT INTO test(title, boby, name) VALUES('test', '&67575@gauss', 'opengauss');
52. INSERT 0 1
53. openGauss=# INSERT INTO test(title, boby, name) VALUES('test1', 'gauss', 'opengauss');
54. INSERT 0 1
55. openGauss=# INSERT INTO test(title, boby, name) VALUES('test2', 'gauss2', 'opengauss');
56. INSERT 0 1
57. openGauss=# INSERT INTO test(title, boby, name) VALUES('test3', 'test', 'opengauss');
58. INSERT 0 1
59. openGauss=# INSERT INTO test(title, boby, name) VALUES('gauss_123_@', 'test', 'opengauss');
60. INSERT 0 1
61. openGauss=# INSERT INTO test(title, boby, name) VALUES('', '', 'opengauss');
62. INSERT 0 1
63. openGauss=# INSERT INTO test(title, boby, name) VALUES(' ', ' ', ' ');
64. INSERT 0 1
65. openGauss=# SELECT * FROM TEST;
66. id | title | boby | name
67. ----+-------------+--------------+-----------
68. 1 | test | &67575@gauss | opengauss
69. 2 | test1 | gauss | opengauss
70. 3 | test2 | gauss2 | opengauss
71. 4 | test3 | test | opengauss
72. 5 | gauss_123_@ | test | opengauss
73. 6 | | | opengauss
74. 7 | | |
75. (7 rows)
77. openGauss=# SELECT * FROM TEST WHERE MATCH (title, boby) AGAINST ('test');
78. id | title | boby | name
79. ----+-------------+--------------+-----------
80. 1 | test | &67575@gauss | opengauss
81. 2 | test1 | gauss | opengauss
82. 3 | test2 | gauss2 | opengauss
83. 4 | test3 | test | opengauss
84. 5 | gauss_123_@ | test | opengauss
85. (5 rows)
87. openGauss=# SELECT * FROM TEST WHERE MATCH (title, boby) AGAINST ('gauss');
88. id | title | boby | name
89. ----+-------------+--------------+-----------
90. 1 | test | &67575@gauss | opengauss
91. 2 | test1 | gauss | opengauss
92. 3 | test2 | gauss2 | opengauss
93. 5 | gauss_123_@ | test | opengauss
94. (4 rows)
96. openGauss=# DROP INDEX test_index_1;
97. DROP INDEX
98. openGauss=# CREATE FULLTEXT INDEX test_index_1 ON test (boby) WITH PARSER ngram;
99. CREATE INDEX
100. openGauss=# \d test_index_1
101. Index "fulltext_test.test_index_1"
102. Column | Type | Definition
103. -------------+------+---------------------------------------
104. to_tsvector | text | to_tsvector('ngram'::regconfig, boby)
105. gin, for table "fulltext_test.test"
107. openGauss=# SELECT * FROM test WHERE MATCH (boby) AGAINST ('test');
108. id | title | boby | name
109. ----+-------------+------+-----------
110. 4 | test3 | test | opengauss
111. 5 | gauss_123_@ | test | opengauss
112. (2 rows)
114. openGauss=# SELECT * FROM test WHERE MATCH (boby) AGAINST ('gauss');
115. id | title | boby | name
116. ----+-------+--------------+-----------
117. 1 | test | &67575@gauss | opengauss
118. 2 | test1 | gauss | opengauss
119. 3 | test2 | gauss2 | opengauss
120. (3 rows)
122. openGauss=# DROP INDEX test_index_1;
123. DROP INDEX
124. openGauss=# CREATE FULLTEXT INDEX test_index_1 ON test (title, boby, name) WITH PARSER ngram;
125. CREATE INDEX
126. openGauss=# \d test_index_1
127. Index "fulltext_test.test_index_1"
128. Column | Type | Definition
129. --------------+------+----------------------------------------------
130. to_tsvector | text | to_tsvector('ngram'::regconfig, title::text)
131. to_tsvector1 | text | to_tsvector('ngram'::regconfig, boby)
132. to_tsvector2 | text | to_tsvector('ngram'::regconfig, name::text)
133. gin, for table "fulltext_test.test"
135. openGauss=# SELECT * FROM test WHERE MATCH (title, boby, name) AGAINST ('test');
136. id | title | boby | name
137. ----+-------------+--------------+-----------
138. 1 | test | &67575@gauss | opengauss
139. 2 | test1 | gauss | opengauss
140. 3 | test2 | gauss2 | opengauss
141. 4 | test3 | test | opengauss
142. 5 | gauss_123_@ | test | opengauss
143. (5 rows)
145. openGauss=# SELECT * FROM test WHERE MATCH (title, boby, name) AGAINST ('gauss');
146. id | title | boby | name
147. ----+-------------+--------------+-----------
148. 1 | test | &67575@gauss | opengauss
149. 2 | test1 | gauss | opengauss
150. 3 | test2 | gauss2 | opengauss
151. 4 | test3 | test | opengauss
152. 5 | gauss_123_@ | test | opengauss
153. 6 | | | opengauss
154. (6 rows)
156. openGauss=# SELECT * FROM test WHERE MATCH (title, boby, name) AGAINST ('opengauss');
157. id | title | boby | name
158. ----+-------------+--------------+-----------
159. 1 | test | &67575@gauss | opengauss
160. 2 | test1 | gauss | opengauss
161. 3 | test2 | gauss2 | opengauss
162. 4 | test3 | test | opengauss
163. 5 | gauss_123_@ | test | opengauss
164. 6 | | | opengauss
165. (6 rows)
167. openGauss=# drop table if exists articles;
168. NOTICE: table "articles" does not exist, skipping
169. DROP TABLE
170. openGauss=# CREATE TABLE articles (
171. openGauss(# ID int,
172. openGauss(# title VARCHAR(100),
173. openGauss(# FULLTEXT INDEX ngram_idx(title)WITH PARSER ngram
174. openGauss(# );
175. CREATE TABLE
176. openGauss=# \d articles
177. Table "fulltext_test.articles"
178. Column | Type | Modifiers
179. --------+------------------------+-----------
180. ID | integer |
181. title | character varying(100) |
182. Indexes:
183. "ngram_idx" gin (to_tsvector('ngram'::regconfig, title::text)) TABLESPACE pg_default
185. openGauss=# drop table if exists articles;
186. DROP TABLE
187. openGauss=# CREATE TABLE articles (
188. openGauss(# ID int,
189. openGauss(# title VARCHAR(100),
190. openGauss(# FULLTEXT INDEX (title)WITH PARSER ngram
191. openGauss(# );
192. CREATE TABLE
193. openGauss=# \d articles
194. Table "fulltext_test.articles"
195. Column | Type | Modifiers
196. --------+------------------------+-----------
197. ID | integer |
198. title | character varying(100) |
199. Indexes:
200. "articles_to_tsvector_idx" gin (to_tsvector('ngram'::regconfig, title::text)) TABLESPACE pg_default
202. openGauss=# drop table if exists articles;
203. DROP TABLE
204. openGauss=# CREATE TABLE articles (
205. openGauss(# ID int,
206. openGauss(# title VARCHAR(100),
207. openGauss(# FULLTEXT KEY keyngram_idx(title)WITH PARSER ngram
208. openGauss(# );
209. CREATE TABLE
210. openGauss=# \d articles
211. Table "fulltext_test.articles"
212. Column | Type | Modifiers
213. --------+------------------------+-----------
214. ID | integer |
215. title | character varying(100) |
216. Indexes:
217. "keyngram_idx" gin (to_tsvector('ngram'::regconfig, title::text)) TABLESPACE pg_default
219. openGauss=# drop table if exists articles;
220. DROP TABLE
221. openGauss=# CREATE TABLE articles (
222. openGauss(# ID int,
223. openGauss(# title VARCHAR(100),
224. openGauss(# FULLTEXT KEY (title)WITH PARSER ngram
225. openGauss(# );
226. CREATE TABLE
227. openGauss=# \d articles
228. Table "fulltext_test.articles"
229. Column | Type | Modifiers
230. --------+------------------------+-----------
231. ID | integer |
232. title | character varying(100) |
233. Indexes:
234. "articles_to_tsvector_idx" gin (to_tsvector('ngram'::regconfig, title::text)) TABLESPACE pg_default
236. openGauss=# create table table_ddl_0154(col1 int,col2 varchar(64), FULLTEXT idx_ddl_0154(col2));
237. CREATE TABLE
238. openGauss=# create table table_ddl_0085(
239. openGauss(# id int(11) not null,
240. openGauss(# username varchar(50) default null,
241. openGauss(# sex varchar(5) default null,
242. openGauss(# address varchar(100) default null,
243. openGauss(# score_num int(11));
244. CREATE TABLE
245. openGauss=# create fulltext index idx_ddl_0085_02 on table_ddl_0085(username);
246. CREATE INDEX
247. openGauss=# insert into table_ddl_0085 values (1,'test','m','xi''an changanqu', 10001), (2,'tst','w','xi''an beilingqu', 10002),
248. (3,'es','w','xi''an yangtaqu', 10003),(4,'s','m','beijingchaoyangqu', 10004);
249. INSERT 0 4
250. openGauss=# SELECT * FROM table_ddl_0085 WHERE MATCH (username) AGAINST ('te' IN NATURAL LANGUAGE MODE);
251. id | username | sex | address | score_num
252. ----+----------+-----+-----------------+-----------
253. 1 | test | m | xi'an changanqu | 10001
254. (1 row)
256. openGauss=# SELECT * FROM table_ddl_0085 WHERE MATCH (username) AGAINST ('ts' IN NATURAL LANGUAGE MODE WITH QUERY EXPANSION);
257. id | username | sex | address | score_num
258. ----+----------+-----+-----------------+-----------
259. 2 | tst | w | xi'an beilingqu | 10002
260. (1 row)
262. openGauss=# SELECT * FROM table_ddl_0085 WHERE MATCH (username) AGAINST ('test' IN BOOLEAN MODE);
263. id | username | sex | address | score_num
264. ----+----------+-----+-----------------+-----------
265. 1 | test | m | xi'an changanqu | 10001
266. (1 row)
268. openGauss=# SELECT * FROM table_ddl_0085 WHERE MATCH (username) AGAINST ('es' WITH QUERY EXPANSION);
269. id | username | sex | address | score_num
270. ----+----------+-----+-----------------+-----------
271. 1 | test | m | xi'an changanqu | 10001
272. 3 | es | w | xi'an yangtaqu | 10003
273. (2 rows)
275. openGauss=# SELECT * FROM table_ddl_0085 WHERE MATCH (username) AGAINST ('s');
276. id | username | sex | address | score_num
277. ----+----------+-----+-------------------+-----------
278. 4 | s | m | beijingchaoyangqu | 10004
279. (1 row)
281. openGauss=# insert into table_ddl_0085 select * from table_ddl_0085 where match (username) against ('te' IN NATURAL LANGUAGE MODE);
282. INSERT 0 1
283. openGauss=# select * from table_ddl_0085;
284. id | username | sex | address | score_num
285. ----+----------+-----+-------------------+-----------
286. 1 | test | m | xi'an changanqu | 10001
287. 2 | tst | w | xi'an beilingqu | 10002
288. 3 | es | w | xi'an yangtaqu | 10003
289. 4 | s | m | beijingchaoyangqu | 10004
290. 1 | test | m | xi'an changanqu | 10001
291. (5 rows)
293. openGauss=# create fulltext index idx_ddl_0085_03 on table_ddl_0085(username) with parser ngram visible;
294. CREATE INDEX
295. openGauss=# create fulltext index idx_ddl_0085_04 on table_ddl_0085(username) visible with parser ngram;
296. CREATE INDEX
297. openGauss=# create fulltext index idx_ddl_0085_05 on table_ddl_0085(username) visible;
298. CREATE INDEX
299. openGauss=# create fulltext index idx_ddl_0085_06 on table_ddl_0085(username) with parser ngram comment 'TEST FULLTEXT INDEX COMMENT';
300. CREATE INDEX
301. openGauss=# create fulltext index idx_ddl_0085_07 on table_ddl_0085(username) comment 'TEST FULLTEXT INDEX COMMENT' with parser ngram;
302. CREATE INDEX
303. openGauss=# create fulltext index idx_ddl_0085_08 on table_ddl_0085(username) comment 'TEST FULLTEXT INDEX COMMENT';
304. CREATE INDEX
305. openGauss=# drop schema fulltext_test cascade;
306. NOTICE: drop cascades to 4 other objects
307. DETAIL: drop cascades to table test
308. drop cascades to table articles
309. drop cascades to table table_ddl_0154
310. drop cascades to table table_ddl_0085
311. DROP SCHEMA
312. openGauss=# reset current_schema;
313. RESET
说明: 指定分区只适合分区表。