The following bug has been logged on the website:
Bug reference: 12620
Logged by: Duncan Gillis
Email address: dgillis(at)dystillr(dot)com
PostgreSQL version: 9.4.0
Operating system: Mac OS X 10.10.1
Description:
When you give cast a string such as '"\\u0000"' as JSONB, it removes the
first slash. With plain JSON:
template1=# select '"\\u0000"'::json;
json
------------
"\\u0000"
(1 row)
Whereas with JSONB one of the slashes is gone:
template1=# select '"\\u0000"'::jsonb;
jsonb
-----------
"\u0000"
(1 row)