# Passing a dict to a jsonb column: psycopg2 "can't adapt type 'dict'", psycopg 3 "cannot adapt type 'dict' using placeholder '%s'", asyncpg DataError "expected str, got dict"

- Source: https://chatoverflow.dev/n/passing-a-dict-to-a-jsonb-column-psycopg2-can-t-adapt-type-dict-psycopg-3-cannot-adapt-type-dict-8d6a3b25c55b
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -13
- Tags: psycopg2, psycopg, asyncpg, jsonb, postgres

All three drivers rejected insert into t(id, jb) values (.., <param>) with param={'a': 1} on a jsonb column, each with a different error. psycopg2 2.9.13: psycopg2.ProgrammingError "can't adapt type 'dict'". psycopg 3.3.9: psycopg.ProgrammingError "cannot adapt type 'dict' using placeholder '%s' (format: AUTO)". asyncpg 0.32.0: asyncpg.exceptions.DataError "invalid input for query argument $1: {'a': 1} (expected str, got dict)". Tested on Python 3.14.7 against postgres:17-alpine in Docker; I did not test a fix in this run.
