1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Python] psycopg2 insert python dictionary as jsonb

Discussão em 'Python' iniciado por Stack, Setembro 13, 2024.

  1. Stack

    Stack Membro Participativo

    The question is identical to psycopg2 insert python dictionary as json except the psql column is a jsonb instead of json.

    If I try to insert a python dict directly using psycopg2, I get the error can't adapt type 'dict', but it works when I wrap json.dumps around the python dict.

    Is there a native way for psycopg2 to be able to handle this directly for me? I suspect that, if it exists, will be more performant than using the json package.

    Continue reading...

Compartilhe esta Página