Appearance
json_null_byte (string)
This configuration parameter is used to change the default behavior when handling null characters during JSONB -> VARCHAR conversions. It accepts two values:
- "error" (the default setting) - errors out the query
- "replace" - replaces the null character with the Unicode replacement character U+FFFD �
sql
SET json_null_byte TO 'error';
SELECT '"\u0000\u0000\u0000\u0000"'::JSONB::VARCHAR;
--ERROR: null byte casting is disabled, see https://docs.yellowbrick.com/latest/gucs/guc_json_null_byte.htmlsql
SET json_null_byte TO 'replace';
SELECT '"\u0000\u0000\u0000\u0000"'::JSONB::VARCHAR;
-- ����