File tree Expand file tree Collapse file tree 2 files changed +18
-18
lines changed Expand file tree Collapse file tree 2 files changed +18
-18
lines changed Original file line number Diff line number Diff line change @@ -17725,28 +17725,28 @@ ERROR: jsonpath member accessor can only be applied to an object
17725
17725
The unwrapping behavior of lax mode can lead to surprising results. For
17726
17726
instance, the following query using the <literal>.**</literal> accessor
17727
17727
selects every <literal>HR</literal> value twice:
17728
- <screen>
17729
- <prompt>=></prompt> <userinput>select jsonb_path_query(:'json', 'lax $.**.HR');</userinput>
17730
- jsonb_path_query
17731
- ------------------
17732
- 73
17733
- 135
17734
- 73
17735
- 135
17736
- </screen>
17728
+ <screen>
17729
+ <prompt>=></prompt> <userinput>select jsonb_path_query(:'json', 'lax $.**.HR');</userinput>
17730
+ jsonb_path_query
17731
+ ------------------
17732
+ 73
17733
+ 135
17734
+ 73
17735
+ 135
17736
+ </screen>
17737
17737
This happens because the <literal>.**</literal> accessor selects both
17738
17738
the <literal>segments</literal> array and each of its elements, while
17739
17739
the <literal>.HR</literal> accessor automatically unwraps arrays when
17740
17740
using lax mode. To avoid surprising results, we recommend using
17741
17741
the <literal>.**</literal> accessor only in strict mode. The
17742
17742
following query selects each <literal>HR</literal> value just once:
17743
- <screen>
17744
- <prompt>=></prompt> <userinput>select jsonb_path_query(:'json', 'strict $.**.HR');</userinput>
17745
- jsonb_path_query
17746
- ------------------
17747
- 73
17748
- 135
17749
- </screen>
17743
+ <screen>
17744
+ <prompt>=></prompt> <userinput>select jsonb_path_query(:'json', 'strict $.**.HR');</userinput>
17745
+ jsonb_path_query
17746
+ ------------------
17747
+ 73
17748
+ 135
17749
+ </screen>
17750
17750
</para>
17751
17751
17752
17752
<para>
Original file line number Diff line number Diff line change @@ -116,8 +116,8 @@ BEGIN;
116
116
now only choose one of these two commands, since all other commands
117
117
will be ignored:
118
118
<programlisting>
119
- ROLLBACK;
120
- ROLLBACK TO SAVEPOINT sp1;
119
+ ROLLBACK;
120
+ ROLLBACK TO SAVEPOINT sp1;
121
121
</programlisting>
122
122
Choosing <command>ROLLBACK</command> will abort everything, including
123
123
value 1, whereas <command>ROLLBACK TO SAVEPOINT sp1</command> will retain
You can’t perform that action at this time.
0 commit comments