Show full detail error message on the console I try to get the error from this call:

$ psql --dbname=synapse -c "SELECT     (json::JSONB-&gt;&gt;'content')::JSONB-&gt;&gt;'name' AS channel_name,     json::JSONB-&gt;&gt;'room_id' AS room_id,     json::JSONB-&gt;&gt;'sender' as sender FROM event_json WHERE json::JSONB-&gt;&gt;'room_id' LIKE '%matrix.org%';";  
Pager usage is off.
FEHLER:  nicht unterstützte Unicode-Escape-Sequenz
DETAIL:  \u0000 kann nicht in »text« umgewandelt werden.
CONTEXT:  JSON-Daten, Zeile 1: ...": {"age_ts": 1535735391873}, "content": {"body":...


but the error message is cut off, how do I get the full error message?
What you see is just the part of the line where PostgreSQL sees a problem, you cannot bet more.

But since you know that the problem is in line 1, you should be able to

SELECT json
FROM event_json
WHERE json::JSONB-&gt;&gt;'room_id' LIKE '%matrix.org%'
LIMIT 1;


and search for the offending \u0000.