Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitca738bd

Browse files
committed
amcheck: Add a test with GIN index on JSONB data
Extend the existing test of GIN checks to also include an index on JSONBdata, using the jsonb_path_ops opclass. This is a common enough usage ofGIN that it makes sense to have better test coverage for it.Author: Mark Dilger <mark.dilger@enterprisedb.com>Reviewed-By: Tomas Vondra <tomas.vondra@enterprisedb.com>Reviewed-By: Kirill Reshke <reshkekirill@gmail.com>Discussion:https://postgr.es/m/BC221A56-977C-418E-A1B8-9EFC881D80C5%40enterprisedb.com
1 parentec4327d commitca738bd

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

‎contrib/amcheck/expected/check_gin.out

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,17 @@ SELECT gin_index_check('gin_check_text_array_idx');
6262

6363
-- cleanup
6464
DROP TABLE gin_check_text_array;
65+
-- Test GIN over jsonb
66+
CREATE TABLE "gin_check_jsonb"("j" jsonb);
67+
INSERT INTO gin_check_jsonb values ('{"a":[["b",{"x":1}],["b",{"x":2}]],"c":3}');
68+
INSERT INTO gin_check_jsonb values ('[[14,2,3]]');
69+
INSERT INTO gin_check_jsonb values ('[1,[14,2,3]]');
70+
CREATE INDEX "gin_check_jsonb_idx" on gin_check_jsonb USING GIN("j" jsonb_path_ops);
71+
SELECT gin_index_check('gin_check_jsonb_idx');
72+
gin_index_check
73+
-----------------
74+
75+
(1 row)
76+
77+
-- cleanup
78+
DROP TABLE gin_check_jsonb;

‎contrib/amcheck/sql/check_gin.sql

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,15 @@ SELECT gin_index_check('gin_check_text_array_idx');
3838

3939
-- cleanup
4040
DROPTABLE gin_check_text_array;
41+
42+
-- Test GIN over jsonb
43+
CREATETABLE "gin_check_jsonb"("j" jsonb);
44+
INSERT INTO gin_check_jsonbvalues ('{"a":[["b",{"x":1}],["b",{"x":2}]],"c":3}');
45+
INSERT INTO gin_check_jsonbvalues ('[[14,2,3]]');
46+
INSERT INTO gin_check_jsonbvalues ('[1,[14,2,3]]');
47+
CREATEINDEX "gin_check_jsonb_idx"on gin_check_jsonb USING GIN("j" jsonb_path_ops);
48+
49+
SELECT gin_index_check('gin_check_jsonb_idx');
50+
51+
-- cleanup
52+
DROPTABLE gin_check_jsonb;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp