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

Appearance settings

Commit 473a352

Browse filesBrowse files
committed
SQL/JSON: Document behavior when input document is not jsonb
The input document to functions JSON_EXISTS(), JSON_QUERY(), JSON_VALUE(), and JSON_TABLE() can be specified as character or UTF8-encoded bytea strings. These are automatically converted to jsonb with an implicit cast before being passed to the jsonpath machinery. In the current implementation, errors that occur when parsing the specified string into a valid JSON document are thrown unconditionally. This means they are not subject to the explicit or implicit ON ERROR clause of those functions, which is a standard- conforming behavior. Add a note to the documentation to mention that. Reported-by: Markus Winand Discussion: https://postgr.es/m/F7DD1442-265C-4220-A603-CB0DEB77E91D%40winand.at
1 parent 5d6c64d commit 473a352
Copy full SHA for 473a352

File tree

Expand file treeCollapse file tree

1 file changed

+10
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+10
-0
lines changed

‎doc/src/sgml/func.sgml

Copy file name to clipboardExpand all lines: doc/src/sgml/func.sgml
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18861,6 +18861,16 @@ DETAIL: Missing "]" after array dimensions.
1886118861
</tbody>
1886218862
</tgroup>
1886318863
</table>
18864+
<note>
18865+
<para>
18866+
The <replaceable>context_item</replaceable> expression is converted to
18867+
<type>jsonb</type> by an implicit cast if the expression is not already of
18868+
type <type>jsonb</type>. Note, however, that any parsing errors that occur
18869+
during that conversion are thrown unconditionally, that is, are not
18870+
handled according to the (specified or implicit) <literal>ON ERROR</literal>
18871+
clause.
18872+
</para>
18873+
</note>
1886418874
</sect2>
1886518875

1886618876
<sect2 id="functions-sqljson-table">

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.