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

Commit4684a13

Browse files
author
Nikita Glukhov
committed
Add missing json functions and operators
1 parent61af37e commit4684a13

File tree

14 files changed

+624
-34
lines changed

14 files changed

+624
-34
lines changed

‎src/backend/catalog/system_views.sql

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,6 +1312,14 @@ LANGUAGE INTERNAL
13121312
STRICT IMMUTABLE PARALLEL SAFE
13131313
AS'make_interval';
13141314

1315+
CREATEOR REPLACE FUNCTION
1316+
json_set(json_in json,pathtext[] , replacement json,
1317+
create_if_missingboolean DEFAULT true)
1318+
RETURNS json
1319+
LANGUAGE INTERNAL
1320+
STRICT IMMUTABLE PARALLEL SAFE
1321+
AS'json_set';
1322+
13151323
CREATEOR REPLACE FUNCTION
13161324
jsonb_set(jsonb_in jsonb,pathtext[] , replacement jsonb,
13171325
create_if_missingboolean DEFAULT true)
@@ -1336,6 +1344,14 @@ LANGUAGE INTERNAL
13361344
STRICT IMMUTABLE PARALLEL SAFE
13371345
AS'parse_ident';
13381346

1347+
CREATEOR REPLACE FUNCTION
1348+
json_insert(json_in json,pathtext[] , replacement json,
1349+
insert_afterboolean DEFAULT false)
1350+
RETURNS json
1351+
LANGUAGE INTERNAL
1352+
STRICT IMMUTABLE PARALLEL SAFE
1353+
AS'json_insert';
1354+
13391355
CREATEOR REPLACE FUNCTION
13401356
jsonb_insert(jsonb_in jsonb,pathtext[] , replacement jsonb,
13411357
insert_afterboolean DEFAULT false)
@@ -1424,6 +1440,88 @@ LANGUAGE INTERNAL
14241440
STRICT STABLE PARALLEL SAFE
14251441
AS'jsonb_path_query_first_tz';
14261442

1443+
1444+
CREATEOR REPLACE FUNCTION
1445+
json_path_exists(target json,path jsonpath, vars json DEFAULT'{}',
1446+
silentboolean DEFAULT false)
1447+
RETURNSboolean
1448+
LANGUAGE INTERNAL
1449+
STRICT IMMUTABLE PARALLEL SAFE
1450+
AS'json_path_exists';
1451+
1452+
CREATEOR REPLACE FUNCTION
1453+
json_path_match(target json,path jsonpath, vars json DEFAULT'{}',
1454+
silentboolean DEFAULT false)
1455+
RETURNSboolean
1456+
LANGUAGE INTERNAL
1457+
STRICT IMMUTABLE PARALLEL SAFE
1458+
AS'json_path_match';
1459+
1460+
CREATEOR REPLACE FUNCTION
1461+
json_path_query(target json,path jsonpath, vars json DEFAULT'{}',
1462+
silentboolean DEFAULT false)
1463+
RETURNS SETOF json
1464+
LANGUAGE INTERNAL
1465+
STRICT IMMUTABLE PARALLEL SAFE
1466+
AS'json_path_query';
1467+
1468+
CREATEOR REPLACE FUNCTION
1469+
json_path_query_array(target json,path jsonpath, vars json DEFAULT'{}',
1470+
silentboolean DEFAULT false)
1471+
RETURNS json
1472+
LANGUAGE INTERNAL
1473+
STRICT IMMUTABLE PARALLEL SAFE
1474+
AS'json_path_query_array';
1475+
1476+
CREATEOR REPLACE FUNCTION
1477+
json_path_query_first(target json,path jsonpath, vars json DEFAULT'{}',
1478+
silentboolean DEFAULT false)
1479+
RETURNS json
1480+
LANGUAGE INTERNAL
1481+
STRICT IMMUTABLE PARALLEL SAFE
1482+
AS'json_path_query_first';
1483+
1484+
CREATEOR REPLACE FUNCTION
1485+
json_path_exists_tz(target json,path jsonpath, vars json DEFAULT'{}',
1486+
silentboolean DEFAULT false)
1487+
RETURNSboolean
1488+
LANGUAGE INTERNAL
1489+
STRICT STABLE PARALLEL SAFE
1490+
AS'json_path_exists_tz';
1491+
1492+
CREATEOR REPLACE FUNCTION
1493+
json_path_match_tz(target json,path jsonpath, vars json DEFAULT'{}',
1494+
silentboolean DEFAULT false)
1495+
RETURNSboolean
1496+
LANGUAGE INTERNAL
1497+
STRICT STABLE PARALLEL SAFE
1498+
AS'json_path_match_tz';
1499+
1500+
CREATEOR REPLACE FUNCTION
1501+
json_path_query_tz(target json,path jsonpath, vars json DEFAULT'{}',
1502+
silentboolean DEFAULT false)
1503+
RETURNS SETOF json
1504+
LANGUAGE INTERNAL
1505+
STRICT STABLE PARALLEL SAFE
1506+
AS'json_path_query_tz';
1507+
1508+
CREATEOR REPLACE FUNCTION
1509+
json_path_query_array_tz(target json,path jsonpath, vars json DEFAULT'{}',
1510+
silentboolean DEFAULT false)
1511+
RETURNS json
1512+
LANGUAGE INTERNAL
1513+
STRICT STABLE PARALLEL SAFE
1514+
AS'json_path_query_array_tz';
1515+
1516+
CREATEOR REPLACE FUNCTION
1517+
json_path_query_first_tz(target json,path jsonpath, vars json DEFAULT'{}',
1518+
silentboolean DEFAULT false)
1519+
RETURNS json
1520+
LANGUAGE INTERNAL
1521+
STRICT STABLE PARALLEL SAFE
1522+
AS'json_path_query_first_tz';
1523+
1524+
14271525
-- default normalization form is NFC, per SQL standard
14281526
CREATEOR REPLACE FUNCTION
14291527
"normalize"(text,text DEFAULT'NFC')

‎src/backend/utils/adt/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ OBJS = \
4545
int8.o\
4646
json.o\
4747
json_generic.o\
48+
json_gin.o\
49+
json_op.o\
4850
jsonb.o\
4951
jsonb_gin.o\
5052
jsonb_op.o\

‎src/backend/utils/adt/json_gin.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* json_gin.c
3+
*
4+
* Portions Copyright (c) 2016, PostgreSQL Global Development Group
5+
*
6+
* IDENTIFICATION
7+
* src/backend/utils/adt/json_gin.c
8+
*
9+
*/
10+
11+
#definegin_compare_jsonbgin_compare_json
12+
#definegin_extract_jsonbgin_extract_json
13+
#definegin_extract_jsonb_querygin_extract_json_query
14+
#definegin_consistent_jsonbgin_consistent_json
15+
#definegin_triconsistent_jsonbgin_triconsistent_json
16+
#definegin_extract_jsonb_pathgin_extract_json_path
17+
#definegin_extract_jsonb_query_pathgin_extract_json_query_path
18+
#definegin_consistent_jsonb_pathgin_consistent_json_path
19+
#definegin_triconsistent_jsonb_pathgin_triconsistent_json_path
20+
21+
#defineJsonxContainerOps(&jsontContainerOps)
22+
#defineJsonxGetDatum(json)JsontGetDatum(json)
23+
24+
#include"utils/json_generic.h"
25+
26+
#include"jsonb_gin.c"

‎src/backend/utils/adt/json_op.c

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* json_op.c
3+
*
4+
* Portions Copyright (c) 2016, PostgreSQL Global Development Group
5+
*
6+
* IDENTIFICATION
7+
* src/backend/utils/adt/json_op.c
8+
*
9+
*/
10+
11+
#definejsonb_existsjson_exists
12+
#definejsonb_exists_anyjson_exists_any
13+
#definejsonb_exists_alljson_exists_all
14+
#definejsonb_containsjson_contains
15+
#definejsonb_containedjson_contained
16+
#definejsonb_nejson_ne
17+
#definejsonb_ltjson_lt
18+
#definejsonb_gtjson_gt
19+
#definejsonb_lejson_le
20+
#definejsonb_gejson_ge
21+
#definejsonb_eqjson_eq
22+
#definejsonb_cmpjson_cmp
23+
#definejsonb_hashjson_hash
24+
#definejsonb_hash_extendedjson_hash_extended
25+
26+
#defineJsonxContainerOps(&jsontContainerOps)
27+
#defineJsonxGetDatum(json)JsontGetDatum(json)
28+
29+
#include"utils/json_generic.h"
30+
31+
#include"jsonb_op.c"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp