Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 63adc7f

Browse files
author
Nikita Glukhov
committed
Remove _ prefix in jsonpath function names
1 parent 6fa9344 commit 63adc7f

File tree

3 files changed

+66
-66
lines changed

3 files changed

+66
-66
lines changed

src/include/catalog/pg_proc.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5480,21 +5480,21 @@ DATA(insert OID = 6052 ( jsonpath_in PGNSP PGUID 12 1 0 0 0 f f f f t f i s
54805480
DESCR("I/O");
54815481
DATA(insert OID = 6053 ( jsonpath_out PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 2275 "6050" _null_ _null_ _null_ _null_ _null_ jsonpath_out _null_ _null_ _null_ ));
54825482
DESCR("I/O");
5483-
DATA(insert OID = 6054 ( _jsonpath_exists PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 16 "3802 6050" _null_ _null_ _null_ _null_ _null_ jsonb_jsonpath_exists2 _null_ _null_ _null_ ));
5483+
DATA(insert OID = 6054 ( jsonpath_exists PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 16 "3802 6050" _null_ _null_ _null_ _null_ _null_ jsonb_jsonpath_exists2 _null_ _null_ _null_ ));
54845484
DESCR("implementation of @? operator");
5485-
DATA(insert OID = 6055 ( _jsonpath_query PGNSP PGUID 12 1 1000 0 0 f f f f t t i s 2 0 3802 "3802 6050" _null_ _null_ _null_ _null_ _null_ jsonb_jsonpath_query2 _null_ _null_ _null_ ));
5485+
DATA(insert OID = 6055 ( jsonpath_query PGNSP PGUID 12 1 1000 0 0 f f f f t t i s 2 0 3802 "3802 6050" _null_ _null_ _null_ _null_ _null_ jsonb_jsonpath_query2 _null_ _null_ _null_ ));
54865486
DESCR("implementation of @* operator");
5487-
DATA(insert OID = 6056 ( _jsonpath_exists PGNSP PGUID 12 1 0 0 0 f f f f t f i s 3 0 16 "3802 6050 3802" _null_ _null_ _null_ _null_ _null_ jsonb_jsonpath_exists3 _null_ _null_ _null_ ));
5487+
DATA(insert OID = 6056 ( jsonpath_exists PGNSP PGUID 12 1 0 0 0 f f f f t f i s 3 0 16 "3802 6050 3802" _null_ _null_ _null_ _null_ _null_ jsonb_jsonpath_exists3 _null_ _null_ _null_ ));
54885488
DESCR("jsonpath exists test");
5489-
DATA(insert OID = 6057 ( _jsonpath_query PGNSP PGUID 12 1 1000 0 0 f f f f t t i s 3 0 3802 "3802 6050 3802" _null_ _null_ _null_ _null_ _null_ jsonb_jsonpath_query3 _null_ _null_ _null_ ));
5489+
DATA(insert OID = 6057 ( jsonpath_query PGNSP PGUID 12 1 1000 0 0 f f f f t t i s 3 0 3802 "3802 6050 3802" _null_ _null_ _null_ _null_ _null_ jsonb_jsonpath_query3 _null_ _null_ _null_ ));
54905490
DESCR("jsonpath object test");
5491-
DATA(insert OID = 6058 ( _jsonpath_query_safe PGNSP PGUID 12 1 1000 0 0 f f f f t t i s 2 0 3802 "3802 6050" _null_ _null_ _null_ _null_ _null_ jsonb_jsonpath_query_safe2 _null_ _null_ _null_ ));
5491+
DATA(insert OID = 6058 ( jsonpath_query_safe PGNSP PGUID 12 1 1000 0 0 f f f f t t i s 2 0 3802 "3802 6050" _null_ _null_ _null_ _null_ _null_ jsonb_jsonpath_query_safe2 _null_ _null_ _null_ ));
54925492
DESCR("jsonpath query, empty on error");
5493-
DATA(insert OID = 6059 ( _jsonpath_query_safe PGNSP PGUID 12 1 1000 0 0 f f f f t t i s 3 0 3802 "3802 6050 3802" _null_ _null_ _null_ _null_ _null_ jsonb_jsonpath_query_safe3 _null_ _null_ _null_ ));
5493+
DATA(insert OID = 6059 ( jsonpath_query_safe PGNSP PGUID 12 1 1000 0 0 f f f f t t i s 3 0 3802 "3802 6050 3802" _null_ _null_ _null_ _null_ _null_ jsonb_jsonpath_query_safe3 _null_ _null_ _null_ ));
54945494
DESCR("jsonpath query, empty on error");
5495-
DATA(insert OID = 6073 ( _jsonpath_predicate PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 16 "3802 6050" _null_ _null_ _null_ _null_ _null_ jsonb_jsonpath_predicate2 _null_ _null_ _null_ ));
5495+
DATA(insert OID = 6073 ( jsonpath_predicate PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 16 "3802 6050" _null_ _null_ _null_ _null_ _null_ jsonb_jsonpath_predicate2 _null_ _null_ _null_ ));
54965496
DESCR("implementation of @~ operator");
5497-
DATA(insert OID = 6074 ( _jsonpath_predicate PGNSP PGUID 12 1 0 0 0 f f f f t f i s 3 0 16 "3802 6050 3802" _null_ _null_ _null_ _null_ _null_ jsonb_jsonpath_predicate3 _null_ _null_ _null_ ));
5497+
DATA(insert OID = 6074 ( jsonpath_predicate PGNSP PGUID 12 1 0 0 0 f f f f t f i s 3 0 16 "3802 6050 3802" _null_ _null_ _null_ _null_ _null_ jsonb_jsonpath_predicate3 _null_ _null_ _null_ ));
54985498
DESCR("jsonpath predicate test");
54995499

55005500
/*

src/test/regress/expected/jsonb_jsonpath.out

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -297,76 +297,76 @@ select jsonb '[1,2,3]' @* '$[last ? (@.type() == "number")]';
297297

298298
select jsonb '[1,2,3]' @* '$[last ? (@.type() == "string")]';
299299
ERROR: Invalid SQL/JSON subscript
300-
select * from _jsonpath_query(jsonb '{"a": 10}', '$');
301-
_jsonpath_query
302-
-----------------
300+
select * from jsonpath_query(jsonb '{"a": 10}', '$');
301+
jsonpath_query
302+
----------------
303303
{"a": 10}
304304
(1 row)
305305

306-
select * from _jsonpath_query(jsonb '{"a": 10}', '$ ? (.a < $value)');
306+
select * from jsonpath_query(jsonb '{"a": 10}', '$ ? (.a < $value)');
307307
ERROR: could not find 'value' passed variable
308-
select * from _jsonpath_query(jsonb '{"a": 10}', '$ ? (.a < $value)', '{"value" : 13}');
309-
_jsonpath_query
310-
-----------------
308+
select * from jsonpath_query(jsonb '{"a": 10}', '$ ? (.a < $value)', '{"value" : 13}');
309+
jsonpath_query
310+
----------------
311311
{"a": 10}
312312
(1 row)
313313

314-
select * from _jsonpath_query(jsonb '{"a": 10}', '$ ? (.a < $value)', '{"value" : 8}');
315-
_jsonpath_query
316-
-----------------
314+
select * from jsonpath_query(jsonb '{"a": 10}', '$ ? (.a < $value)', '{"value" : 8}');
315+
jsonpath_query
316+
----------------
317317
(0 rows)
318318

319-
select * from _jsonpath_query(jsonb '{"a": 10}', '$.a ? (@ < $value)', '{"value" : 13}');
320-
_jsonpath_query
321-
-----------------
319+
select * from jsonpath_query(jsonb '{"a": 10}', '$.a ? (@ < $value)', '{"value" : 13}');
320+
jsonpath_query
321+
----------------
322322
10
323323
(1 row)
324324

325-
select * from _jsonpath_query(jsonb '[10,11,12,13,14,15]', '$.[*] ? (@ < $value)', '{"value" : 13}');
326-
_jsonpath_query
327-
-----------------
325+
select * from jsonpath_query(jsonb '[10,11,12,13,14,15]', '$.[*] ? (@ < $value)', '{"value" : 13}');
326+
jsonpath_query
327+
----------------
328328
10
329329
11
330330
12
331331
(3 rows)
332332

333-
select * from _jsonpath_query(jsonb '[10,11,12,13,14,15]', '$.[0,1] ? (@ < $value)', '{"value" : 13}');
334-
_jsonpath_query
335-
-----------------
333+
select * from jsonpath_query(jsonb '[10,11,12,13,14,15]', '$.[0,1] ? (@ < $value)', '{"value" : 13}');
334+
jsonpath_query
335+
----------------
336336
10
337337
11
338338
(2 rows)
339339

340-
select * from _jsonpath_query(jsonb '[10,11,12,13,14,15]', '$.[0 to 2] ? (@ < $value)', '{"value" : 15}');
341-
_jsonpath_query
342-
-----------------
340+
select * from jsonpath_query(jsonb '[10,11,12,13,14,15]', '$.[0 to 2] ? (@ < $value)', '{"value" : 15}');
341+
jsonpath_query
342+
----------------
343343
10
344344
11
345345
12
346346
(3 rows)
347347

348-
select * from _jsonpath_query(jsonb '[1,"1",2,"2",null]', '$.[*] ? (@ == "1")');
349-
_jsonpath_query
350-
-----------------
348+
select * from jsonpath_query(jsonb '[1,"1",2,"2",null]', '$.[*] ? (@ == "1")');
349+
jsonpath_query
350+
----------------
351351
"1"
352352
(1 row)
353353

354-
select * from _jsonpath_query(jsonb '[1,"1",2,"2",null]', '$.[*] ? (@ == $value)', '{"value" : "1"}');
355-
_jsonpath_query
356-
-----------------
354+
select * from jsonpath_query(jsonb '[1,"1",2,"2",null]', '$.[*] ? (@ == $value)', '{"value" : "1"}');
355+
jsonpath_query
356+
----------------
357357
"1"
358358
(1 row)
359359

360-
select * from _jsonpath_query(jsonb '[1, "2", null]', '$[*] ? (@ != null)');
361-
_jsonpath_query
362-
-----------------
360+
select * from jsonpath_query(jsonb '[1, "2", null]', '$[*] ? (@ != null)');
361+
jsonpath_query
362+
----------------
363363
1
364364
"2"
365365
(2 rows)
366366

367-
select * from _jsonpath_query(jsonb '[1, "2", null]', '$[*] ? (@ == null)');
368-
_jsonpath_query
369-
-----------------
367+
select * from jsonpath_query(jsonb '[1, "2", null]', '$[*] ? (@ == null)');
368+
jsonpath_query
369+
----------------
370370
null
371371
(1 row)
372372

@@ -581,7 +581,7 @@ select jsonb '{"g": {"x": 2}}' @* '$.g ? (exists (@.x ? (@ >= 2) ))';
581581
--test ternary logic
582582
select
583583
x, y,
584-
_jsonpath_query(
584+
jsonpath_query(
585585
jsonb '[true, false, null]',
586586
'$[*] ? (@ == true && ($x == true && $y == true) ||
587587
@ == false && !($x == true && $y == true) ||
@@ -606,7 +606,7 @@ from
606606

607607
select
608608
x, y,
609-
_jsonpath_query(
609+
jsonpath_query(
610610
jsonb '[true, false, null]',
611611
'$[*] ? (@ == true && ($x == true || $y == true) ||
612612
@ == false && !($x == true || $y == true) ||
@@ -850,15 +850,15 @@ select jsonb '[1,2,3]' @~ '$[*]';
850850
ERROR: Singleton SQL/JSON item required
851851
select jsonb '[]' @~ '$[*]';
852852
ERROR: Singleton SQL/JSON item required
853-
select _jsonpath_predicate(jsonb '[[1, true], [2, false]]', 'strict $[*] ? (@[0] > $x) [1]', '{"x": 1}');
854-
_jsonpath_predicate
855-
---------------------
853+
select jsonpath_predicate(jsonb '[[1, true], [2, false]]', 'strict $[*] ? (@[0] > $x) [1]', '{"x": 1}');
854+
jsonpath_predicate
855+
--------------------
856856
f
857857
(1 row)
858858

859-
select _jsonpath_predicate(jsonb '[[1, true], [2, false]]', 'strict $[*] ? (@[0] < $x) [1]', '{"x": 2}');
860-
_jsonpath_predicate
861-
---------------------
859+
select jsonpath_predicate(jsonb '[[1, true], [2, false]]', 'strict $[*] ? (@[0] < $x) [1]', '{"x": 2}');
860+
jsonpath_predicate
861+
--------------------
862862
t
863863
(1 row)
864864

src/test/regress/sql/jsonb_jsonpath.sql

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,18 @@ select jsonb '[1,2,3]' @* '$[last - 1]';
5252
select jsonb '[1,2,3]' @* '$[last ? (@.type() == "number")]';
5353
select jsonb '[1,2,3]' @* '$[last ? (@.type() == "string")]';
5454

55-
select * from _jsonpath_query(jsonb '{"a": 10}', '$');
56-
select * from _jsonpath_query(jsonb '{"a": 10}', '$ ? (.a < $value)');
57-
select * from _jsonpath_query(jsonb '{"a": 10}', '$ ? (.a < $value)', '{"value" : 13}');
58-
select * from _jsonpath_query(jsonb '{"a": 10}', '$ ? (.a < $value)', '{"value" : 8}');
59-
select * from _jsonpath_query(jsonb '{"a": 10}', '$.a ? (@ < $value)', '{"value" : 13}');
60-
select * from _jsonpath_query(jsonb '[10,11,12,13,14,15]', '$.[*] ? (@ < $value)', '{"value" : 13}');
61-
select * from _jsonpath_query(jsonb '[10,11,12,13,14,15]', '$.[0,1] ? (@ < $value)', '{"value" : 13}');
62-
select * from _jsonpath_query(jsonb '[10,11,12,13,14,15]', '$.[0 to 2] ? (@ < $value)', '{"value" : 15}');
63-
select * from _jsonpath_query(jsonb '[1,"1",2,"2",null]', '$.[*] ? (@ == "1")');
64-
select * from _jsonpath_query(jsonb '[1,"1",2,"2",null]', '$.[*] ? (@ == $value)', '{"value" : "1"}');
65-
select * from _jsonpath_query(jsonb '[1, "2", null]', '$[*] ? (@ != null)');
66-
select * from _jsonpath_query(jsonb '[1, "2", null]', '$[*] ? (@ == null)');
55+
select * from jsonpath_query(jsonb '{"a": 10}', '$');
56+
select * from jsonpath_query(jsonb '{"a": 10}', '$ ? (.a < $value)');
57+
select * from jsonpath_query(jsonb '{"a": 10}', '$ ? (.a < $value)', '{"value" : 13}');
58+
select * from jsonpath_query(jsonb '{"a": 10}', '$ ? (.a < $value)', '{"value" : 8}');
59+
select * from jsonpath_query(jsonb '{"a": 10}', '$.a ? (@ < $value)', '{"value" : 13}');
60+
select * from jsonpath_query(jsonb '[10,11,12,13,14,15]', '$.[*] ? (@ < $value)', '{"value" : 13}');
61+
select * from jsonpath_query(jsonb '[10,11,12,13,14,15]', '$.[0,1] ? (@ < $value)', '{"value" : 13}');
62+
select * from jsonpath_query(jsonb '[10,11,12,13,14,15]', '$.[0 to 2] ? (@ < $value)', '{"value" : 15}');
63+
select * from jsonpath_query(jsonb '[1,"1",2,"2",null]', '$.[*] ? (@ == "1")');
64+
select * from jsonpath_query(jsonb '[1,"1",2,"2",null]', '$.[*] ? (@ == $value)', '{"value" : "1"}');
65+
select * from jsonpath_query(jsonb '[1, "2", null]', '$[*] ? (@ != null)');
66+
select * from jsonpath_query(jsonb '[1, "2", null]', '$[*] ? (@ == null)');
6767

6868
select jsonb '{"a": {"b": 1}}' @* 'lax $.**';
6969
select jsonb '{"a": {"b": 1}}' @* 'lax $.**{1}';
@@ -106,7 +106,7 @@ select jsonb '{"g": {"x": 2}}' @* '$.g ? (exists (@.x ? (@ >= 2) ))';
106106
--test ternary logic
107107
select
108108
x, y,
109-
_jsonpath_query(
109+
jsonpath_query(
110110
jsonb '[true, false, null]',
111111
'$[*] ? (@ == true && ($x == true && $y == true) ||
112112
@ == false && !($x == true && $y == true) ||
@@ -119,7 +119,7 @@ from
119119

120120
select
121121
x, y,
122-
_jsonpath_query(
122+
jsonpath_query(
123123
jsonb '[true, false, null]',
124124
'$[*] ? (@ == true && ($x == true || $y == true) ||
125125
@ == false && !($x == true || $y == true) ||
@@ -175,8 +175,8 @@ select jsonb '{}' @~ '$';
175175
select jsonb '[]' @~ '$';
176176
select jsonb '[1,2,3]' @~ '$[*]';
177177
select jsonb '[]' @~ '$[*]';
178-
select _jsonpath_predicate(jsonb '[[1, true], [2, false]]', 'strict $[*] ? (@[0] > $x) [1]', '{"x": 1}');
179-
select _jsonpath_predicate(jsonb '[[1, true], [2, false]]', 'strict $[*] ? (@[0] < $x) [1]', '{"x": 2}');
178+
select jsonpath_predicate(jsonb '[[1, true], [2, false]]', 'strict $[*] ? (@[0] > $x) [1]', '{"x": 1}');
179+
select jsonpath_predicate(jsonb '[[1, true], [2, false]]', 'strict $[*] ? (@[0] < $x) [1]', '{"x": 2}');
180180

181181
select jsonb '[null,1,true,"a",[],{}]' @* '$.type()';
182182
select jsonb '[null,1,true,"a",[],{}]' @* 'lax $.type()';

0 commit comments

Comments
 (0)