1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-13 07:41:39 +03:00

GIN support for @@ and @? jsonpath operators

This commit makes existing GIN operator classes jsonb_ops and json_path_ops
support "jsonb @@ jsonpath" and "jsonb @? jsonpath" operators.  Basic idea is
to extract statements of following form out of jsonpath.

 key1.key2. ... .keyN = const

The rest of jsonpath is rechecked from heap.

Catversion is bumped.

Discussion: https://postgr.es/m/fcc6fc6a-b497-f39a-923d-aa34d0c588e8%402ndQuadrant.com
Author: Nikita Glukhov, Alexander Korotkov
Reviewed-by: Jonathan Katz, Pavel Stehule
This commit is contained in:
Alexander Korotkov
2019-04-01 18:08:15 +03:00
parent 7241911782
commit 0a02e2ae02
11 changed files with 1457 additions and 79 deletions

View File

@ -35,6 +35,8 @@ typedef struct
#define PG_GETARG_JSONPATH_P_COPY(x) DatumGetJsonPathPCopy(PG_GETARG_DATUM(x))
#define PG_RETURN_JSONPATH_P(p) PG_RETURN_POINTER(p)
#define jspIsScalar(type) ((type) >= jpiNull && (type) <= jpiBool)
/*
* All node's type of jsonpath expression
*/