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

Commit7ac0193

Browse files
author
Nikita Glukhov
committed
Add missing json functions and operators
1 parent9073c78 commit7ac0193

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
@@ -1315,6 +1315,14 @@ LANGUAGE INTERNAL
13151315
STRICT IMMUTABLE PARALLEL SAFE
13161316
AS'make_interval';
13171317

1318+
CREATEOR REPLACE FUNCTION
1319+
json_set(json_in json,pathtext[] , replacement json,
1320+
create_if_missingboolean DEFAULT true)
1321+
RETURNS json
1322+
LANGUAGE INTERNAL
1323+
STRICT IMMUTABLE PARALLEL SAFE
1324+
AS'json_set';
1325+
13181326
CREATEOR REPLACE FUNCTION
13191327
jsonb_set(jsonb_in jsonb,pathtext[] , replacement jsonb,
13201328
create_if_missingboolean DEFAULT true)
@@ -1339,6 +1347,14 @@ LANGUAGE INTERNAL
13391347
STRICT IMMUTABLE PARALLEL SAFE
13401348
AS'parse_ident';
13411349

1350+
CREATEOR REPLACE FUNCTION
1351+
json_insert(json_in json,pathtext[] , replacement json,
1352+
insert_afterboolean DEFAULT false)
1353+
RETURNS json
1354+
LANGUAGE INTERNAL
1355+
STRICT IMMUTABLE PARALLEL SAFE
1356+
AS'json_insert';
1357+
13421358
CREATEOR REPLACE FUNCTION
13431359
jsonb_insert(jsonb_in jsonb,pathtext[] , replacement jsonb,
13441360
insert_afterboolean DEFAULT false)
@@ -1427,6 +1443,88 @@ LANGUAGE INTERNAL
14271443
STRICT STABLE PARALLEL SAFE
14281444
AS'jsonb_path_query_first_tz';
14291445

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