type
JSON
PostgreSQL JSON validates JSON syntax and preserves the original input text. SQL NULL and JSON null are distinct. Example target: PostgreSQL 17. Run in a disposable database; examples need no existing tables.
Formal Syntax & Structure
sql syntaxsql
JSONWorking Example
Example Snippetsql
SELECT CAST(CAST('{"x": 1}' AS JSON) AS TEXT);