json

to_jsonb

Converts a SQL value to jsonb; a text argument becomes a JSON string, not parsed JSON.

Formal Syntax & Structure

sql syntaxsql
to_jsonb(anyelement)

Working Example

Example Snippetsql
SELECT to_jsonb('[7]'::text);
SQL Reference