Update: I added:

from psycopg2.extras import Json


And wrapped my value:

a_dictionary = Json(a_dictionary)


Which moved me forward to:

sqlalchemy.exc.ProgrammingError: (ProgrammingError) function 
update_json_with_oplog_entry(json, unknown) does not exist


How do I define argument types of a custom function?

On Friday, August 22, 2014 11:50:01 AM UTC-4, Stefan Urbanek wrote:
>
> Hi,
>
> I have a custom PostgreSQL function that takes two JSON-type arguments:
>
> CREATE OR REPLACE FUNCTION "update_json"(original json, update_obj json)
>
>
> When I try to use the function in sqlalchemy:
>
> a_dictionary = dict(...)
>
> value = sqlalchemy.sql.func.update_json(a_json_column, a_dictionary) 
>
> table.update().values(a_json_column=value)
>
>
> It fails with:
>
> sqlalchemy.exc.ProgrammingError: (ProgrammingError) can't adapt type 
> 'dict' 
>
>
> What am I missing?
>
> Thanks,
>
> Stefan 
>

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to