Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes 5026 Add PostgreSql grammar for GIN #5027

Merged
merged 2 commits into from
Mar 27, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,10 @@ table_constraint ::= [ CONSTRAINT {identifier} ] (
override = true
}

create_index_stmt ::= CREATE [ UNIQUE ] INDEX [ 'CONCURRENTLY' ] [ IF NOT EXISTS ] [ {database_name} DOT ] {index_name} ON {table_name} LP {indexed_column} ( COMMA {indexed_column} ) * RP [ WHERE <<expr '-1'>> ] {
gin_operator_class_stmt ::= 'array_ops' | 'jsonb_ops' | 'jsonb_path_ops' | 'tsvector_ops'

create_index_stmt ::= CREATE [ UNIQUE ] INDEX [ 'CONCURRENTLY' ] [ IF NOT EXISTS ] [ {database_name} DOT ] {index_name} ON {table_name}
( USING 'GIN' LP {indexed_column} [ gin_operator_class_stmt ] ( COMMA {indexed_column} [ gin_operator_class_stmt ] ) * RP | LP {indexed_column} ( COMMA {indexed_column} ) * RP [ WHERE <<expr '-1'>> ] ) {
extends = "com.alecstrong.sql.psi.core.psi.impl.SqlCreateIndexStmtImpl"
implements = "com.alecstrong.sql.psi.core.psi.SqlGeneratedClause"
override = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,15 @@ CREATE TABLE abg (
);

CREATE INDEX CONCURRENTLY beta_gamma_idx ON abg (beta, gamma);


CREATE TABLE json_gin(
alpha JSONB,
beta JSONB
);

CREATE INDEX gin_alpha_1 ON json_gin USING GIN (alpha);
CREATE INDEX gin_alpha_beta_2 ON json_gin USING GIN (alpha, beta);
CREATE INDEX gin_alpha_beta_3 ON json_gin USING GIN (alpha jsonb_ops, beta);
CREATE INDEX gin_alpha_beta_4 ON json_gin USING GIN (alpha, beta jsonb_path_ops);
CREATE INDEX gin_alpha_beta_5 ON json_gin USING GIN (alpha jsonb_path_ops, beta jsonb_ops);