↑↓ select ↵ open ⌫ change scope Open full search

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

Functions / Json Functions And Operators

jsonb_populate_record_valid

Read the PG 18 manual

Function for testing jsonb_populate_record.

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

Signatures & examples

jsonb_populate_record_valid ( base anyelement, from_json json ) → boolean
Function for testing jsonb_populate_record. Returns true if the input jsonb_populate_record would finish without an error for the given input JSON object; that is, it's valid input, false otherwise.
select jsonb_populate_record_valid(NULL::jsb_char2, '{"a": "aaa"}'); →  jsonb_populate_record_valid
-----------------------------
 f
(1 row)
select * from jsonb_populate_record(NULL::jsb_char2, '{"a": "aaa"}') q; → ERROR:  value too long for type character(2)
select jsonb_populate_record_valid(NULL::jsb_char2, '{"a": "aa"}'); →  jsonb_populate_record_valid
-----------------------------
 t
(1 row)
select * from jsonb_populate_record(NULL::jsb_char2, '{"a": "aa"}') q; →  a
----
 aa
(1 row)
Version history 1
  1. 16 → 17 added

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