↑↓ 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 type of the top-level JSON value as a text string.

Reading PG 18current·documented in 14 of 27 versions, 9.4 to 20

Signatures & examples

json_typeof ( json ) → text
Returns the type of the top-level JSON value as a text string. Possible types are object, array, string, number, boolean, and null. (The null result should not be confused with an SQL NULL; see the examples.)
json_typeof('-123.4') → number
json_typeof('null'::json) → null
json_typeof(NULL::json) IS NULL → t
Version history 3
  1. 13 → 14 changed
  2. 12 → 13 changed
  3. 9.3 → 9.4 added

Definition snapshot: 2026-09-14T13:14:25.684213+00:00@99e6866c · English manual source