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

Commitf71136e

Browse files
committed
Get rid of bogus separate pg_proc entries for json_extract_path operators.
These should not have existed to begin with, but there was apparently somemisunderstanding of the purpose of the opr_sanity regression test itemthat checks for operator implementation functions with their own comments.The idea there is to check for unintentional violations of the rule thatoperator implementation functions shouldn't be documented separately.... but for these functions, that is in fact what we want, since thevariadic option is useful and not accessible via the operator syntax.Get rid of the extra pg_proc entries and fix the regression test anddocumentation to be explicit about what we're doing here.
1 parent344eed9 commitf71136e

File tree

5 files changed

+21
-19
lines changed

5 files changed

+21
-19
lines changed

‎doc/src/sgml/func.sgml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10524,7 +10524,8 @@ table2-mapping
1052410524
<entry><para><type>json</type></para><para><type>jsonb</type>
1052510525
</para></entry>
1052610526
<entry>
10527-
Returns JSON value pointed to by <replaceable>path_elems</replaceable>.
10527+
Returns JSON value pointed to by <replaceable>path_elems</replaceable>
10528+
(equivalent to <literal>#&gt;</literal> operator).
1052810529
</entry>
1052910530
<entry><literal>json_extract_path('{"f2":{"f3":1},"f4":{"f5":99,"f6":"foo"}}','f4')</literal></entry>
1053010531
<entry><literal>{"f5":99,"f6":"foo"}</literal></entry>
@@ -10536,7 +10537,8 @@ table2-mapping
1053610537
<entry><type>text</type></entry>
1053710538
<entry>
1053810539
Returns JSON value pointed to by <replaceable>path_elems</replaceable>
10539-
as <type>text</>.
10540+
as <type>text</>
10541+
(equivalent to <literal>#&gt;&gt;</literal> operator).
1054010542
</entry>
1054110543
<entry><literal>json_extract_path_text('{"f2":{"f3":1},"f4":{"f5":99,"f6":"foo"}}','f4', 'f6')</literal></entry>
1054210544
<entry><literal>foo</literal></entry>

‎src/include/catalog/catversion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@
5353
*/
5454

5555
/*yyyymmddN */
56-
#defineCATALOG_VERSION_NO201406181
56+
#defineCATALOG_VERSION_NO201406262
5757

5858
#endif

‎src/include/catalog/pg_operator.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1767,9 +1767,9 @@ DATA(insert OID = 3964 ( "->" PGNSP PGUID b f f 114 23 114 0 0 json_array_el
17671767
DESCR("get json array element");
17681768
DATA(insertOID=3965 ("->>"PGNSPPGUIDbff114232500json_array_element_text-- ));
17691769
DESCR("get json array element as text");
1770-
DATA(insertOID=3966 ("#>"PGNSPPGUIDbff114100911400json_extract_path_op-- ));
1770+
DATA(insertOID=3966 ("#>"PGNSPPGUIDbff114100911400json_extract_path-- ));
17711771
DESCR("get value from json with path elements");
1772-
DATA(insertOID=3967 ("#>>"PGNSPPGUIDbff11410092500json_extract_path_text_op-- ));
1772+
DATA(insertOID=3967 ("#>>"PGNSPPGUIDbff11410092500json_extract_path_text-- ));
17731773
DESCR("get value from json as text with path elements");
17741774
DATA(insertOID=3211 ("->"PGNSPPGUIDbff380225380200jsonb_object_field-- ));
17751775
DESCR("get jsonb object field");
@@ -1779,9 +1779,9 @@ DATA(insert OID = 3212 ( "->" PGNSP PGUID b f f 3802 23 3802 0 0 jsonb_array
17791779
DESCR("get jsonb array element");
17801780
DATA(insertOID=3481 ("->>"PGNSPPGUIDbff3802232500jsonb_array_element_text-- ));
17811781
DESCR("get jsonb array element as text");
1782-
DATA(insertOID=3213 ("#>"PGNSPPGUIDbff38021009380200jsonb_extract_path_op-- ));
1782+
DATA(insertOID=3213 ("#>"PGNSPPGUIDbff38021009380200jsonb_extract_path-- ));
17831783
DESCR("get value from jsonb with path elements");
1784-
DATA(insertOID=3206 ("#>>"PGNSPPGUIDbff380210092500jsonb_extract_path_text_op-- ));
1784+
DATA(insertOID=3206 ("#>>"PGNSPPGUIDbff380210092500jsonb_extract_path_text-- ));
17851785
DESCR("get value from jsonb as text with path elements");
17861786
DATA(insertOID=3240 ("="PGNSPPGUIDbtt380238021632403241jsonb_eqeqseleqjoinsel ));
17871787
DESCR("equal");

‎src/include/catalog/pg_proc.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4230,10 +4230,8 @@ DATA(insert OID = 3949 ( json_array_elementPGNSP PGUID 12 1 0 0 0 f f f f t f
42304230
DATA(insertOID=3950 (json_array_element_textPGNSPPGUID121000fffftfi2025"114 23"_null__null_"{from_json, element_index}"_null_json_array_element_text_null__null__null_ ));
42314231
DATA(insertOID=3951 (json_extract_pathPGNSPPGUID1210250fffftfi20114"114 1009""{114,1009}""{i,v}""{from_json,path_elems}"_null_json_extract_path_null__null__null_ ));
42324232
DESCR("get value from json with path elements");
4233-
DATA(insertOID=3952 (json_extract_path_opPGNSPPGUID121000fffftfi20114"114 1009"_null__null_"{from_json,path_elems}"_null_json_extract_path_null__null__null_ ));
42344233
DATA(insertOID=3953 (json_extract_path_textPGNSPPGUID1210250fffftfi2025"114 1009""{114,1009}""{i,v}""{from_json,path_elems}"_null_json_extract_path_text_null__null__null_ ));
42354234
DESCR("get value from json as text with path elements");
4236-
DATA(insertOID=3954 (json_extract_path_text_opPGNSPPGUID121000fffftfi2025"114 1009"_null__null_"{from_json,path_elems}"_null_json_extract_path_text_null__null__null_ ));
42374235
DATA(insertOID=3955 (json_array_elementsPGNSPPGUID12110000fffftti10114"114""{114,114}""{i,o}""{from_json,value}"_null_json_array_elements_null__null__null_ ));
42384236
DESCR("key value pairs of a json object");
42394237
DATA(insertOID=3969 (json_array_elements_textPGNSPPGUID12110000fffftti1025"114""{114,25}""{i,o}""{from_json,value}"_null_json_array_elements_text_null__null__null_ ));
@@ -4593,10 +4591,8 @@ DATA(insert OID = 3215 ( jsonb_array_elementPGNSP PGUID 12 1 0 0 0 f f f f t
45934591
DATA(insertOID=3216 (jsonb_array_element_textPGNSPPGUID121000fffftfi2025"3802 23"_null__null_"{from_json, element_index}"_null_jsonb_array_element_text_null__null__null_ ));
45944592
DATA(insertOID=3217 (jsonb_extract_pathPGNSPPGUID1210250fffftfi203802"3802 1009""{3802,1009}""{i,v}""{from_json,path_elems}"_null_jsonb_extract_path_null__null__null_ ));
45954593
DESCR("get value from jsonb with path elements");
4596-
DATA(insertOID=3939 (jsonb_extract_path_opPGNSPPGUID121000fffftfi203802"3802 1009"_null__null_"{from_json,path_elems}"_null_jsonb_extract_path_null__null__null_ ));
45974594
DATA(insertOID=3940 (jsonb_extract_path_textPGNSPPGUID1210250fffftfi2025"3802 1009""{3802,1009}""{i,v}""{from_json,path_elems}"_null_jsonb_extract_path_text_null__null__null_ ));
45984595
DESCR("get value from jsonb as text with path elements");
4599-
DATA(insertOID=3218 (jsonb_extract_path_text_opPGNSPPGUID121000fffftfi2025"3802 1009"_null__null_"{from_json,path_elems}"_null_jsonb_extract_path_text_null__null__null_ ));
46004596
DATA(insertOID=3219 (jsonb_array_elementsPGNSPPGUID12110000fffftti103802"3802""{3802,3802}""{i,o}""{from_json,value}"_null_jsonb_array_elements_null__null__null_ ));
46014597
DESCR("elements of a jsonb array");
46024598
DATA(insertOID=3465 (jsonb_array_elements_textPGNSPPGUID12110000fffftti1025"3802""{3802,25}""{i,o}""{from_json,value}"_null_jsonb_array_elements_text_null__null__null_ ));

‎src/test/regress/expected/opr_sanity.out

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,14 +1045,18 @@ SELECT p_oid, proname, prodesc FROM funcdescs
10451045
WHERE prodesc IS DISTINCT FROM expecteddesc
10461046
AND oprdesc NOT LIKE 'deprecated%'
10471047
ORDER BY 1;
1048-
p_oid | proname | prodesc
1049-
-------+---------------+-------------------------------------
1050-
378 | array_append | append element onto end of array
1051-
379 | array_prepend | prepend element onto front of array
1052-
1035 | aclinsert | add/update ACL item
1053-
1036 | aclremove | remove ACL item
1054-
1037 | aclcontains | contains
1055-
(5 rows)
1048+
p_oid | proname | prodesc
1049+
-------+-------------------------+-------------------------------------------------
1050+
378 | array_append | append element onto end of array
1051+
379 | array_prepend | prepend element onto front of array
1052+
1035 | aclinsert | add/update ACL item
1053+
1036 | aclremove | remove ACL item
1054+
1037 | aclcontains | contains
1055+
3217 | jsonb_extract_path | get value from jsonb with path elements
1056+
3940 | jsonb_extract_path_text | get value from jsonb as text with path elements
1057+
3951 | json_extract_path | get value from json with path elements
1058+
3953 | json_extract_path_text | get value from json as text with path elements
1059+
(9 rows)
10561060

10571061
-- **************** pg_aggregate ****************
10581062
-- Look for illegal values in pg_aggregate fields.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp