How to safely insert a jsonb into a table?
Is it dangerous to use jsonb (that comes from the user) within queries?


Not it's not dangerous because that JSON is essentially just text as it comes from the client, and you've protected yourself by using prepared statements. This text will be transparently fed to the internal function jsonb_in, and you'll be totally safe.