↑↓ select ↵ open ⌫ change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Functions / Json Functions And Operators

Returns the result of applying the SQL/JSON path_expression to the context_item.

Reading PG 18current·documented in 4 of 27 versions, 17 to 20

Signatures & examples

JSON_QUERY ( context_item, path_expression [PASSING { value AS varname } [, ...]] [RETURNING data_type [FORMAT JSON [ENCODING UTF8] ] ] [ { WITHOUT | WITH { CONDITIONAL | [UNCONDITIONAL] } } [ARRAY] WRAPPER] [ { KEEP | OMIT } QUOTES [ON SCALAR STRING] ] [ { ERROR | NULL | EMPTY { [ARRAY] | OBJECT } | DEFAULT expression } ON EMPTY] [ { ERROR | NULL | EMPTY { [ARRAY] | OBJECT } | DEFAULT expression } ON ERROR]) → jsonb
Returns the result of applying the SQL/JSON path_expression to the context_item.
Version history 1
  1. 16 → 17 added

Definition snapshot: b7bd9cda · English manual source