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

Commitf6b45f1

Browse files
author
Nikita Glukhov
committed
Add missing json functions and operators
1 parentfb4ab66 commitf6b45f1

File tree

14 files changed

+623
-33
lines changed

14 files changed

+623
-33
lines changed

‎src/backend/catalog/system_views.sql

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1416,6 +1416,14 @@ LANGUAGE INTERNAL
14161416
STRICT IMMUTABLE PARALLEL SAFE
14171417
AS'make_interval';
14181418

1419+
CREATEOR REPLACE FUNCTION
1420+
json_set(json_in json,pathtext[] , replacement json,
1421+
create_if_missingboolean DEFAULT true)
1422+
RETURNS json
1423+
LANGUAGE INTERNAL
1424+
STRICT IMMUTABLE PARALLEL SAFE
1425+
AS'json_set';
1426+
14191427
CREATEOR REPLACE FUNCTION
14201428
jsonb_set(jsonb_in jsonb,pathtext[] , replacement jsonb,
14211429
create_if_missingboolean DEFAULT true)
@@ -1440,6 +1448,14 @@ LANGUAGE INTERNAL
14401448
STRICT IMMUTABLE PARALLEL SAFE
14411449
AS'parse_ident';
14421450

1451+
CREATEOR REPLACE FUNCTION
1452+
json_insert(json_in json,pathtext[] , replacement json,
1453+
insert_afterboolean DEFAULT false)
1454+
RETURNS json
1455+
LANGUAGE INTERNAL
1456+
STRICT IMMUTABLE PARALLEL SAFE
1457+
AS'json_insert';
1458+
14431459
CREATEOR REPLACE FUNCTION
14441460
jsonb_insert(jsonb_in jsonb,pathtext[] , replacement jsonb,
14451461
insert_afterboolean DEFAULT false)
@@ -1528,6 +1544,88 @@ LANGUAGE INTERNAL
15281544
STRICT STABLE PARALLEL SAFE
15291545
AS'jsonb_path_query_first_tz';
15301546

1547+
1548+
CREATEOR REPLACE FUNCTION
1549+
json_path_exists(target json,path jsonpath, vars json DEFAULT'{}',
1550+
silentboolean DEFAULT false)
1551+
RETURNSboolean
1552+
LANGUAGE INTERNAL
1553+
STRICT IMMUTABLE PARALLEL SAFE
1554+
AS'json_path_exists';
1555+
1556+
CREATEOR REPLACE FUNCTION
1557+
json_path_match(target json,path jsonpath, vars json DEFAULT'{}',
1558+
silentboolean DEFAULT false)
1559+
RETURNSboolean
1560+
LANGUAGE INTERNAL
1561+
STRICT IMMUTABLE PARALLEL SAFE
1562+
AS'json_path_match';
1563+
1564+
CREATEOR REPLACE FUNCTION
1565+
json_path_query(target json,path jsonpath, vars json DEFAULT'{}',
1566+
silentboolean DEFAULT false)
1567+
RETURNS SETOF json
1568+
LANGUAGE INTERNAL
1569+
STRICT IMMUTABLE PARALLEL SAFE
1570+
AS'json_path_query';
1571+
1572+
CREATEOR REPLACE FUNCTION
1573+
json_path_query_array(target json,path jsonpath, vars json DEFAULT'{}',
1574+
silentboolean DEFAULT false)
1575+
RETURNS json
1576+
LANGUAGE INTERNAL
1577+
STRICT IMMUTABLE PARALLEL SAFE
1578+
AS'json_path_query_array';
1579+
1580+
CREATEOR REPLACE FUNCTION
1581+
json_path_query_first(target json,path jsonpath, vars json DEFAULT'{}',
1582+
silentboolean DEFAULT false)
1583+
RETURNS json
1584+
LANGUAGE INTERNAL
1585+
STRICT IMMUTABLE PARALLEL SAFE
1586+
AS'json_path_query_first';
1587+
1588+
CREATEOR REPLACE FUNCTION
1589+
json_path_exists_tz(target json,path jsonpath, vars json DEFAULT'{}',
1590+
silentboolean DEFAULT false)
1591+
RETURNSboolean
1592+
LANGUAGE INTERNAL
1593+
STRICT STABLE PARALLEL SAFE
1594+
AS'json_path_exists_tz';
1595+
1596+
CREATEOR REPLACE FUNCTION
1597+
json_path_match_tz(target json,path jsonpath, vars json DEFAULT'{}',
1598+
silentboolean DEFAULT false)
1599+
RETURNSboolean
1600+
LANGUAGE INTERNAL
1601+
STRICT STABLE PARALLEL SAFE
1602+
AS'json_path_match_tz';
1603+
1604+
CREATEOR REPLACE FUNCTION
1605+
json_path_query_tz(target json,path jsonpath, vars json DEFAULT'{}',
1606+
silentboolean DEFAULT false)
1607+
RETURNS SETOF json
1608+
LANGUAGE INTERNAL
1609+
STRICT STABLE PARALLEL SAFE
1610+
AS'json_path_query_tz';
1611+
1612+
CREATEOR REPLACE FUNCTION
1613+
json_path_query_array_tz(target json,path jsonpath, vars json DEFAULT'{}',
1614+
silentboolean DEFAULT false)
1615+
RETURNS json
1616+
LANGUAGE INTERNAL
1617+
STRICT STABLE PARALLEL SAFE
1618+
AS'json_path_query_array_tz';
1619+
1620+
CREATEOR REPLACE FUNCTION
1621+
json_path_query_first_tz(target json,path jsonpath, vars json DEFAULT'{}',
1622+
silentboolean DEFAULT false)
1623+
RETURNS json
1624+
LANGUAGE INTERNAL
1625+
STRICT STABLE PARALLEL SAFE
1626+
AS'json_path_query_first_tz';
1627+
1628+
15311629
-- default normalization form is NFC, per SQL standard
15321630
CREATEOR REPLACE FUNCTION
15331631
"normalize"(text,text DEFAULT'NFC')

‎src/backend/utils/adt/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ OBJS = \
4646
int8.o\
4747
json.o\
4848
json_generic.o\
49+
json_gin.o\
50+
json_op.o\
4951
jsonb.o\
5052
jsonb_gin.o\
5153
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